gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19324 - libmicrohttpd/src/daemon


From: gnunet
Subject: [GNUnet-SVN] r19324 - libmicrohttpd/src/daemon
Date: Mon, 23 Jan 2012 12:50:25 +0100

Author: grothoff
Date: 2012-01-23 12:50:25 +0100 (Mon, 23 Jan 2012)
New Revision: 19324

Modified:
   libmicrohttpd/src/daemon/daemon.c
Log:
fix double-free in case HTTPS_PRIORITIES value is set to an invalid string

Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c   2012-01-23 09:24:30 UTC (rev 19323)
+++ libmicrohttpd/src/daemon/daemon.c   2012-01-23 11:50:25 UTC (rev 19324)
@@ -1786,15 +1786,17 @@
              ret = gnutls_priority_init (&daemon->priority_cache,
                                          pstr = va_arg (ap, const char*),
                                          NULL);
+             if (ret != GNUTLS_E_SUCCESS)
+             {
 #if HAVE_MESSAGES
-             if (ret != GNUTLS_E_SUCCESS)
                FPRINTF (stderr,
                         "Setting priorities to `%s' failed: %s\n",
                         pstr,
                         gnutls_strerror (ret));
 #endif   
-             if (ret != GNUTLS_E_SUCCESS)
+               daemon->priority_cache = NULL;
                return MHD_NO;
+             }
            }
           break;
 #endif
@@ -2053,7 +2055,8 @@
   if (MHD_YES != parse_options_va (retVal, &servaddr, ap))
     {
 #if HTTPS_SUPPORT
-      if (options & MHD_USE_SSL)
+      if ( (0 != (options & MHD_USE_SSL)) &&
+          (NULL != retVal->priority_cache) )
        gnutls_priority_deinit (retVal->priority_cache);
 #endif
       free (retVal);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]