]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Free the priority structure on error. Reported by Paul Aurich.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 2 Apr 2010 08:13:15 +0000 (10:13 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 14 Apr 2010 15:17:31 +0000 (17:17 +0200)
lib/gnutls_priority.c

index cc0b98acf0920dea90efedd52d113a1a1ead8f2d..e4cd9e76a93d9a68309899926706dcf150626961 100644 (file)
@@ -566,7 +566,7 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
 {
   char *broken_list[MAX_ELEMENTS];
   int broken_list_size, i, j;
-  char *darg;
+  char *darg = NULL;
   int algo;
   rmadd_func *fn;
 
@@ -585,9 +585,10 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
   if (darg == NULL)
     {
       gnutls_assert ();
-      return GNUTLS_E_MEMORY_ERROR;
+      goto error;
     }
 
+
   break_comma_list (darg, broken_list, &broken_list_size, MAX_ELEMENTS, ':');
   /* This is our default set of protocol version, certificate types and
    * compression methods.
@@ -759,6 +760,7 @@ error:
        }
     }
   gnutls_free (darg);
+  gnutls_free(*priority_cache);
 
   return GNUTLS_E_INVALID_REQUEST;