From: Marko Kreen Date: Fri, 11 Jan 2008 21:50:07 +0000 (+0000) Subject: slab: if constructor is not given, memset on alloc X-Git-Tag: pgbouncer_1_2_rc2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ee24bc1f8c080f2e01d1f54ba79adb96659f0de;p=pgbouncer slab: if constructor is not given, memset on alloc --- diff --git a/src/slab.c b/src/slab.c index d91ffac..c33904c 100644 --- a/src/slab.c +++ b/src/slab.c @@ -173,6 +173,8 @@ void *obj_alloc(ObjectCache *cache) grow(cache); item = statlist_pop(&cache->freelist); } + if (item && !cache->init_func) + memset(item, 0, cache->final_size); return item; }