From: Pavel Rochnyack Date: Fri, 21 Jul 2017 18:06:58 +0000 (+0700) Subject: network: Fix free() before use X-Git-Tag: collectd-5.6.3~10^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=678d8eafdf17da0ef94053f5c017c12152eb69b0;p=collectd.git network: Fix free() before use --- diff --git a/src/network.c b/src/network.c index 2ff09af3..fbb42fcb 100644 --- a/src/network.c +++ b/src/network.c @@ -1230,9 +1230,9 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */ part_size - buffer_offset, /* in = */ NULL, /* in len = */ 0); if (err != 0) { - sfree(pea.username); ERROR("network plugin: gcry_cipher_decrypt returned: %s. Username: %s", gcry_strerror(err), pea.username); + sfree(pea.username); return (-1); } @@ -1254,8 +1254,6 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */ parse_packet(se, buffer + buffer_offset, payload_len, flags | PP_ENCRYPTED, pea.username); - /* XXX: Free pea.username?!? */ - /* Update return values */ *ret_buffer = buffer + part_size; *ret_buffer_len = buffer_len - part_size;