diff options
author | Nikos Mavrogiannopoulos <nmav@crystal.(none)> | 2008-09-21 10:13:43 +0300 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@crystal.(none)> | 2008-09-21 10:13:43 +0300 |
commit | 45a1a9d908917ed98caa70b56dc4b1b83457d78f (patch) | |
tree | 64c1ea7b8bf931ccebe3d14ac8c7f263f62ef716 /lib/gnutls_pk.c | |
parent | 9cc794959c740baf7c1a348c7a143679a8a69138 (diff) | |
download | gnutls-45a1a9d908917ed98caa70b56dc4b1b83457d78f.tar.gz |
Corrected memory leak. Reported by Sam Varshavchik.
Diffstat (limited to 'lib/gnutls_pk.c')
-rw-r--r-- | lib/gnutls_pk.c | 4 |
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; } |