From: Wayne Davison Date: Tue, 10 Feb 2004 17:52:31 +0000 (+0000) Subject: If we call pool_alloc() on a NULL pool, bomb out with an error. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/aa0b9ca174023a4f9b0cfc830a76b6e170982203 If we call pool_alloc() on a NULL pool, bomb out with an error. --- diff --git a/lib/pool_alloc.c b/lib/pool_alloc.c index 9eff5294..4c93ea1d 100644 --- a/lib/pool_alloc.c +++ b/lib/pool_alloc.c @@ -90,7 +90,12 @@ pool_alloc(alloc_pool_t p, size_t len, char *bomb) { struct alloc_pool *pool = (struct alloc_pool *) p; if (!pool) - return NULL; + { + char *msg; + if (asprintf(&msg, "pool_alloc(%s) on NULL pool", bomb) > 0) + bomb = msg; + goto bomb; + } if (!len) len = pool->quantum;