]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Deallocate memory from parameters only when function run was successful.
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>
Fri, 11 Apr 2008 23:18:46 +0000 (02:18 +0300)
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>
Fri, 11 Apr 2008 23:18:46 +0000 (02:18 +0300)
lib/openpgp/output.c

index c9ce42e1f0eaff08c53650b2efa877d1f5af9ecf..c5b3276c67a3c009a7086b9ad9fd88a9d8242aae 100644 (file)
@@ -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;