summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2015-06-18 12:50:32 +0530
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-18 13:26:36 +0200
commitb0c5ba7b3d3779060f7e6cc685bc4098e9dab680 (patch)
treeabf6c03f080e809b831bf1ff7100d77067386670 /src/cli.c
parent53b7883d29620b77efb3ff3c5cf58c0099f297b4 (diff)
downloadgnutls-b0c5ba7b3d3779060f7e6cc685bc4098e9dab680.tar.gz
gnutls-cli: Fixed Possible Memory Leak
This patch fixes possible memory leak in psk_callback() function, rawkey is allocated memory by gnutls_malloc() and is not freed when gnutls_hex_decode() returns with error Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cli.c b/src/cli.c
index d0e75a2f04..58c2d1d0b4 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1714,6 +1714,7 @@ psk_callback(gnutls_session_t session, char **username,
if (ret < 0) {
fprintf(stderr, "Error deriving password: %s\n",
gnutls_strerror(ret));
+ gnutls_free(rawkey);
gnutls_free(*username);
return ret;
}