summaryrefslogtreecommitdiff
path: root/lib/gnutls_pk.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-09-21 10:13:43 +0300
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-09-21 10:13:43 +0300
commit45a1a9d908917ed98caa70b56dc4b1b83457d78f (patch)
tree64c1ea7b8bf931ccebe3d14ac8c7f263f62ef716 /lib/gnutls_pk.c
parent9cc794959c740baf7c1a348c7a143679a8a69138 (diff)
downloadgnutls-45a1a9d908917ed98caa70b56dc4b1b83457d78f.tar.gz
Corrected memory leak. Reported by Sam Varshavchik.
Diffstat (limited to 'lib/gnutls_pk.c')
-rw-r--r--lib/gnutls_pk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c
index 88e4a1ff27..5c84c5a881 100644
--- a/lib/gnutls_pk.c
+++ b/lib/gnutls_pk.c
@@ -531,15 +531,17 @@ _generate_params (int algo, bigint_t * resarr, unsigned int *resarr_len,
gnutls_assert ();
return ret;
}
-
+
if (resarr && resarr_len && *resarr_len >= params.params_nr)
{
*resarr_len = params.params_nr;
for (i = 0; i < params.params_nr; i++)
resarr[i] = params.params[i];
+ gnutls_free(params.params);
}
else
{
+ gnutls_free(params.params);
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
}