apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r582228 - /apr/apr-util/trunk/buckets/apr_buckets_alloc.c
Date Fri, 05 Oct 2007 12:30:53 GMT
Author: jim
Date: Fri Oct  5 05:30:53 2007
New Revision: 582228

URL: http://svn.apache.org/viewvc?rev=582228&view=rev
Log:
We should really check these

Modified:
    apr/apr-util/trunk/buckets/apr_buckets_alloc.c

Modified: apr/apr-util/trunk/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/buckets/apr_buckets_alloc.c?rev=582228&r1=582227&r2=582228&view=diff
==============================================================================
--- apr/apr-util/trunk/buckets/apr_buckets_alloc.c (original)
+++ apr/apr-util/trunk/buckets/apr_buckets_alloc.c Fri Oct  5 05:30:53 2007
@@ -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