From 678d8eafdf17da0ef94053f5c017c12152eb69b0 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Sat, 22 Jul 2017 01:06:58 +0700 Subject: [PATCH] network: Fix free() before use --- src/network.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; -- 2.30.2