apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r685262 - /apr/apr-util/branches/1.3.x/memcache/apr_memcache.c
Date Tue, 12 Aug 2008 18:47:05 GMT
Author: rpluem
Date: Tue Aug 12 11:47:05 2008
New Revision: 685262

URL: http://svn.apache.org/viewvc?rev=685262&view=rev
Log:
* Fix a memory leak introduced in r683756 and a free call to a non malloced
  pointer in the case that the platform has no threads.
  Remark: This is not a backport from trunk since code in trunk works
  differently. On trunk we use the possibility to run pre cleanups on pool
  destruction.

Pointed out by: trawick

Modified:
    apr/apr-util/branches/1.3.x/memcache/apr_memcache.c

Modified: apr/apr-util/branches/1.3.x/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/memcache/apr_memcache.c?rev=685262&r1=685261&r2=685262&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/memcache/apr_memcache.c (original)
+++ apr/apr-util/branches/1.3.x/memcache/apr_memcache.c Tue Aug 12 11:47:05 2008
@@ -343,6 +343,9 @@
 
     if (rv != APR_SUCCESS) {
         apr_pool_destroy(np);
+#if APR_HAS_THREADS
+        free(conn);
+#endif
         return rv;
     }
 
@@ -359,7 +362,9 @@
     rv = conn_connect(conn);
     if (rv != APR_SUCCESS) {
         apr_pool_destroy(np);
+#if APR_HAS_THREADS
         free(conn);
+#endif
     }
     else {
         apr_pool_cleanup_register(np, conn, conn_clean, apr_pool_cleanup_null);



Mime
View raw message