You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by sf...@apache.org on 2011/10/15 23:41:26 UTC

svn commit: r1183736 - /apr/apr-util/branches/1.5.x/memcache/apr_memcache.c

Author: sf
Date: Sat Oct 15 21:41:25 2011
New Revision: 1183736

URL: http://svn.apache.org/viewvc?rev=1183736&view=rev
Log:
Backport r1183689:

    Fix possible segfault.

    PR: 51064
    Submitted by: Michajlo Matijkiw <michajlo_matijkiw comcast com>


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

Modified: apr/apr-util/branches/1.5.x/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/memcache/apr_memcache.c?rev=1183736&r1=1183735&r2=1183736&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/memcache/apr_memcache.c (original)
+++ apr/apr-util/branches/1.5.x/memcache/apr_memcache.c Sat Oct 15 21:41:25 2011
@@ -418,15 +418,17 @@ APU_DECLARE(apr_status_t) apr_memcache_s
                                mc_conn_construct,       /* Make a New Connection */
                                mc_conn_destruct,        /* Kill Old Connection */
                                server, np);
+    if (rv != APR_SUCCESS) {
+        return rv;
+    }
 
     apr_reslist_cleanup_order_set(server->conns, APR_RESLIST_CLEANUP_FIRST);
 #else
     rv = mc_conn_construct((void**)&(server->conn), server, np);
-#endif
-
     if (rv != APR_SUCCESS) {
         return rv;
     }
+#endif
 
     *ms = server;