apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r652621 - /apr/apr-util/branches/0.9.x/buckets/apr_buckets_alloc.c
Date Thu, 01 May 2008 18:55:25 GMT
Author: jim
Date: Thu May  1 11:55:25 2008
New Revision: 652621

URL: http://svn.apache.org/viewvc?rev=652621&view=rev
Log:
r582228

Modified:
    apr/apr-util/branches/0.9.x/buckets/apr_buckets_alloc.c

Modified: apr/apr-util/branches/0.9.x/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/0.9.x/buckets/apr_buckets_alloc.c?rev=652621&r1=652620&r2=652621&view=diff
==============================================================================
--- apr/apr-util/branches/0.9.x/buckets/apr_buckets_alloc.c (original)
+++ apr/apr-util/branches/0.9.x/buckets/apr_buckets_alloc.c Thu May  1 11:55:25 2008
@@ -85,6 +85,9 @@
     apr_memnode_t *block;
 
     block = apr_allocator_alloc(allocator, ALLOC_AMT);
+    if (!block) {
+        return NULL;
+    }
     list = (apr_bucket_alloc_t *)block->first_avail;
     list->pool = NULL;
     list->allocator = allocator;
@@ -127,6 +130,9 @@
             endp = active->first_avail + SMALL_NODE_SIZE;
             if (endp >= active->endp) {
                 list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT);
+                if (!list->blocks) {
+                    return NULL;
+                }
                 list->blocks->next = active;
                 active = list->blocks;
                 endp = active->first_avail + SMALL_NODE_SIZE;
@@ -140,6 +146,9 @@
     }
     else {
         apr_memnode_t *memnode = apr_allocator_alloc(list->allocator, size);
+        if (!memnode) {
+            return NULL;
+        }
         node = (node_header_t *)memnode->first_avail;
         node->alloc = list;
         node->memnode = memnode;



Mime
View raw message