--- apr_buckets_alloc.cvs.c	Thu Aug 28 09:08:39 2003
+++ apr_buckets_alloc.c	Tue Sep 02 15:57:29 2003
@@ -139,10 +139,13 @@
         else {
             endp = active->first_avail + SMALL_NODE_SIZE;
             if (endp >= active->endp) {
-                list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT);
-                list->blocks->next = active;
-                active = list->blocks;
-                endp = active->first_avail + SMALL_NODE_SIZE;
+                if ((list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT)) == NULL)
+                	return NULL;
+				else {
+	                list->blocks->next = active;
+    	            active = list->blocks;
+        	        endp = active->first_avail + SMALL_NODE_SIZE;
+				}
             }
             node = (node_header_t *)active->first_avail;
             node->alloc = list;
@@ -153,10 +156,14 @@
     }
     else {
         apr_memnode_t *memnode = apr_allocator_alloc(list->allocator, size);
-        node = (node_header_t *)memnode->first_avail;
-        node->alloc = list;
-        node->memnode = memnode;
-        node->size = size;
+		if (memnode == NULL)
+			return NULL;
+		else {
+	        node = (node_header_t *)memnode->first_avail;
+    	    node->alloc = list;
+        	node->memnode = memnode;
+	        node->size = size;
+		}
     }
     return ((char *)node) + SIZEOF_NODE_HEADER_T;
 }
