]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10167: Missing NULL assignment to alloc list during cleanup, tests run on linux.
authorShane Bryldt <astaelan@gmail.com>
Tue, 11 Apr 2017 20:51:35 +0000 (15:51 -0500)
committerShane Bryldt <astaelan@gmail.com>
Tue, 11 Apr 2017 20:51:35 +0000 (15:51 -0500)
libs/libks/src/ks_pool.c

index 905afdf0300f6ac1453042db0a2060ac3d56a7d3..b9b9fc69e73c757cb2589ec317487fe8659eaac4 100644 (file)
@@ -305,7 +305,7 @@ static void *alloc_mem(ks_pool_t *pool, const ks_size_t size, ks_status_t *error
        prefix->magic4 = KS_POOL_PREFIX_MAGIC;
 
        write_fence(fence);
-       
+
        if (pool->log_func != NULL) {
                pool->log_func(pool, KS_POOL_FUNC_INCREF, prefix->size, prefix->refs, NULL, addr, 0);
        }
@@ -456,7 +456,7 @@ KS_DECLARE(ks_status_t) ks_pool_open(ks_pool_t **poolP)
 {
        ks_status_t ret = KS_STATUS_SUCCESS;
        ks_pool_t *pool = NULL;
-       
+
        ks_assert(poolP);
 
        pool = ks_pool_raw_open(KS_POOL_FLAG_DEFAULT, &ret);
@@ -576,6 +576,7 @@ KS_DECLARE(ks_status_t) ks_pool_clear(ks_pool_t *pool)
                // @todo check_prefix()? still want to clear out properly if some has been cleared though, not leak memory if there has been corruption
                free(prefix);
        }
+       pool->first = pool->last = NULL;
 
        ks_mutex_unlock(pool->mutex);
 
@@ -944,7 +945,7 @@ done:
  * DESCRIPTION:
  *
  * Reallocate an address in a mmeory pool to a new size.  This is
- * different from realloc in that it needs the old address' size.  
+ * different from realloc in that it needs the old address' size.
  *
  * RETURNS:
  *