[Python-modules-commits] r24749 - in packages/pycurl/trunk/debian (3 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Tue Jun 11 22:03:45 UTC 2013


    Date: Tuesday, June 11, 2013 @ 22:03:43
  Author: morph
Revision: 24749

* debian/patches/50_dont_leak_user_agent.patch
  - fix memory leak in reset(); thanks to ?\195?\150rjan Persson for the report and
    patch; Closes: #709226

Added:
  packages/pycurl/trunk/debian/patches/50_dont_leak_user_agent.patch
Modified:
  packages/pycurl/trunk/debian/changelog
  packages/pycurl/trunk/debian/patches/series

Modified: packages/pycurl/trunk/debian/changelog
===================================================================
--- packages/pycurl/trunk/debian/changelog	2013-06-11 21:10:43 UTC (rev 24748)
+++ packages/pycurl/trunk/debian/changelog	2013-06-11 22:03:43 UTC (rev 24749)
@@ -1,9 +1,15 @@
 pycurl (7.19.0-7) UNRELEASED; urgency=low
 
+  [ Jakub Wilk ]
   * Use canonical URIs for Vcs-* fields.
 
- -- Jakub Wilk <jwilk at debian.org>  Sun, 05 May 2013 16:01:39 +0200
+  [ Sandro Tosi ]
+  * debian/patches/50_dont_leak_user_agent.patch
+    - fix memory leak in reset(); thanks to Örjan Persson for the report and
+      patch; Closes: #709226
 
+ -- Sandro Tosi <morph at debian.org>  Tue, 11 Jun 2013 23:40:28 +0200
+
 pycurl (7.19.0-6) experimental; urgency=low
 
   * debian/patches/20_remove_string_options.patch

Added: packages/pycurl/trunk/debian/patches/50_dont_leak_user_agent.patch
===================================================================
--- packages/pycurl/trunk/debian/patches/50_dont_leak_user_agent.patch	                        (rev 0)
+++ packages/pycurl/trunk/debian/patches/50_dont_leak_user_agent.patch	2013-06-11 22:03:43 UTC (rev 24749)
@@ -0,0 +1,43 @@
+Description: fix a memory leak in reset() function
+Author: Örjan Persson <orjan at spotify.com>
+
+Index: pycurl-openssl/src/pycurl.c
+===================================================================
+--- pycurl-openssl.orig/src/pycurl.c	2013-05-14 18:51:53.040481318 -0700
++++ pycurl-openssl/src/pycurl.c	2013-05-14 18:58:03.705278225 -0700
+@@ -98,6 +98,9 @@
+ #define OPTIONS_SIZE    ((int)CURLOPT_LASTENTRY % 10000)
+ #define MOPTIONS_SIZE   ((int)CURLMOPT_LASTENTRY % 10000)
+ 
++/* Keep some default variables around */
++static const char g_pycurl_useragent[7 + sizeof(LIBCURL_VERSION) + 1];
++
+ /* Type objects */
+ static PyObject *ErrorObject = NULL;
+ static PyTypeObject *p_Curl_Type = NULL;
+@@ -780,14 +783,8 @@
+     }
+ 
+     /* Set default USERAGENT */
+-    s = (char *) malloc(7 + strlen(LIBCURL_VERSION) + 1);
+-    if (s == NULL) {
+-        return (-1);
+-    }
+-    strcpy(s, "PycURL/"); strcpy(s+7, LIBCURL_VERSION);
+-    res = curl_easy_setopt(self->handle, CURLOPT_USERAGENT, (char *) s);
++    res = curl_easy_setopt(self->handle, CURLOPT_USERAGENT, (char *) g_pycurl_useragent);
+     if (res != CURLE_OK) {
+-        free(s);
+         return (-1);
+     }
+     return (0);
+@@ -3953,6 +3950,9 @@
+         assert(0);
+     }
+ 
++    strcpy(g_pycurl_useragent, "PycURL/");
++    strcpy(g_pycurl_useragent+7, LIBCURL_VERSION);
++
+     /* Initialize callback locks if ssl is enabled */
+ #if defined(PYCURL_NEED_SSL_TSL)
+     pycurl_ssl_init();

Modified: packages/pycurl/trunk/debian/patches/series
===================================================================
--- packages/pycurl/trunk/debian/patches/series	2013-06-11 21:10:43 UTC (rev 24748)
+++ packages/pycurl/trunk/debian/patches/series	2013-06-11 22:03:43 UTC (rev 24749)
@@ -2,3 +2,4 @@
 20_remove_string_options.patch
 30_fix_refcounts_calling_reset_twice.patch
 40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch
+50_dont_leak_user_agent.patch




More information about the Python-modules-commits mailing list