From: Nikos Mavrogiannopoulos Date: Fri, 2 Apr 2010 08:13:15 +0000 (+0200) Subject: Free the priority structure on error. Reported by Paul Aurich. X-Git-Tag: gnutls_2_9_10~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89e5f6cfcfb6ad4cbfd18f1c757f5f851819ccb9;p=thirdparty%2Fgnutls.git Free the priority structure on error. Reported by Paul Aurich. --- diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c index cc0b98acf0..e4cd9e76a9 100644 --- a/lib/gnutls_priority.c +++ b/lib/gnutls_priority.c @@ -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;