]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
data stack: Fixes to handling out-of-memory situations.
authorTimo Sirainen <tss@iki.fi>
Wed, 28 Oct 2009 18:10:55 +0000 (14:10 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 28 Oct 2009 18:10:55 +0000 (14:10 -0400)
--HG--
branch : HEAD

src/lib/data-stack.c

index fe5977ee7a121776e8595c3882f12d13116d67e2..092f0f8817139ef78b85156b3a374295a459e544 100644 (file)
@@ -69,7 +69,7 @@ static bool outofmem = FALSE;
 
 static union {
        struct stack_block block;
-       unsigned char data[128];
+       unsigned char data[512];
 } outofmem_area;
 
 static void data_stack_last_buffer_reset(bool preserve_data ATTR_UNUSED)
@@ -169,7 +169,8 @@ static void free_blocks(struct stack_block *block)
                        unused_block = block;
                } else {
 #ifndef USE_GC
-                       free(block);
+                       if (block != &outofmem_area.block)
+                               free(block);
 #endif
                }