Avoid warning about leaked mem (didn't affect rsync's pool use).
authorWayne Davison <wayned@samba.org>
Tue, 15 Jan 2019 18:40:18 +0000 (10:40 -0800)
committerWayne Davison <wayned@samba.org>
Tue, 15 Jan 2019 18:46:29 +0000 (10:46 -0800)
lib/pool_alloc.c

index 5856d591f154b19f0d036292a939ac18f0df4b4a..a70a3f1a46b2c0332867f2aef64191ab7c5d1ad9 100644 (file)
@@ -49,15 +49,15 @@ pool_create(size_t size, size_t quantum, void (*bomb)(const char *), int flags)
 {
        struct alloc_pool *pool;
 
 {
        struct alloc_pool *pool;
 
-       if (!(pool = new0(struct alloc_pool)))
-               return NULL;
-
        if ((MINALIGN & (MINALIGN - 1)) != 0) {
                if (bomb)
                        (*bomb)("Compiler error: MINALIGN is not a power of 2\n");
                return NULL;
        }
 
        if ((MINALIGN & (MINALIGN - 1)) != 0) {
                if (bomb)
                        (*bomb)("Compiler error: MINALIGN is not a power of 2\n");
                return NULL;
        }
 
+       if (!(pool = new0(struct alloc_pool)))
+               return NULL;
+
        if (!size)
                size = POOL_DEF_EXTENT;
        if (!quantum)
        if (!size)
                size = POOL_DEF_EXTENT;
        if (!quantum)