From: Nikos Mavrogiannopoulos Date: Fri, 11 Apr 2008 23:18:46 +0000 (+0300) Subject: Deallocate memory from parameters only when function run was successful. X-Git-Tag: gnutls_2_3_5~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=778e38b506d4e7a2ced58dbce762ee9a7140f1f4;p=thirdparty%2Fgnutls.git Deallocate memory from parameters only when function run was successful. --- diff --git a/lib/openpgp/output.c b/lib/openpgp/output.c index c9ce42e1f0..c5b3276c67 100644 --- a/lib/openpgp/output.c +++ b/lib/openpgp/output.c @@ -250,10 +250,11 @@ print_key_info(gnutls_string * str, gnutls_openpgp_crt_t cert, int idx) hexdump (str, m.data, m.size, "\t\t\t"); addf (str, _("\t\tExponent:\n")); hexdump (str, e.data, e.size, "\t\t\t"); + + gnutls_free (m.data); + gnutls_free (e.data); } - gnutls_free (m.data); - gnutls_free (e.data); } break; @@ -278,6 +279,11 @@ print_key_info(gnutls_string * str, gnutls_openpgp_crt_t cert, int idx) hexdump (str, q.data, q.size, "\t\t\t"); addf (str, _("\t\tG:\n")); hexdump (str, g.data, g.size, "\t\t\t"); + + gnutls_free (p.data); + gnutls_free (q.data); + gnutls_free (g.data); + gnutls_free (y.data); } } break;