apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1460344 - in /apr/apr-util/branches/1.5.x: ./ buckets/apr_buckets_alloc.c
Date Sun, 24 Mar 2013 12:56:11 GMT
Author: sf
Date: Sun Mar 24 12:56:10 2013
New Revision: 1460344

URL: http://svn.apache.org/r1460344
Log:
Merge r1402907,1406088:

    If out of mem, abort instead of crashing. Use the pool's abort function
    if it has one.

    Make sure we abort, even if the abortfunc returns

Modified:
    apr/apr-util/branches/1.5.x/   (props changed)
    apr/apr-util/branches/1.5.x/buckets/apr_buckets_alloc.c

Propchange: apr/apr-util/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1402907,1406088

Modified: apr/apr-util/branches/1.5.x/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/buckets/apr_buckets_alloc.c?rev=1460344&r1=1460343&r2=1460344&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/buckets/apr_buckets_alloc.c (original)
+++ apr/apr-util/branches/1.5.x/buckets/apr_buckets_alloc.c Sun Mar 24 12:56:10 2013
@@ -65,12 +65,20 @@ APU_DECLARE_NONSTD(apr_bucket_alloc_t *)
     /* may be NULL for debug mode. */
     if (allocator == NULL) {
         if (apr_allocator_create(&allocator) != APR_SUCCESS) {
+            apr_abortfunc_t fn = apr_pool_abort_get(p);
+            if (fn)
+                (fn)(APR_ENOMEM);
             abort();
         }
     }
 #endif
-
     list = apr_bucket_alloc_create_ex(allocator);
+    if (list == NULL) {
+            apr_abortfunc_t fn = apr_pool_abort_get(p);
+            if (fn)
+                (fn)(APR_ENOMEM);
+            abort();
+    }
     list->pool = p;
     apr_pool_cleanup_register(list->pool, list, alloc_cleanup,
                               apr_pool_cleanup_null);



Mime
View raw message