X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached_result.c;h=cf3894bef3b7545fcdaca9be56d6e1883f25b2a3;hb=8a86b578acc594d37a8638e3e0afba1286c4b6ca;hp=89de40301552ff891ca908b481068edd822f6692;hpb=d283f47cade6fcd1256e738057667fbcca7b06c1;p=m6w6%2Flibmemcached diff --git a/lib/memcached_result.c b/lib/memcached_result.c index 89de4030..cf3894be 100644 --- a/lib/memcached_result.c +++ b/lib/memcached_result.c @@ -17,8 +17,12 @@ memcached_result_st *memcached_result_create(memcached_st *memc, } else { - ptr= (memcached_result_st *)malloc(sizeof(memcached_result_st)); - if (!ptr) + if (memc->call_malloc) + ptr= (memcached_result_st *)memc->call_malloc(memc, sizeof(memcached_result_st)); + else + ptr= (memcached_result_st *)malloc(sizeof(memcached_result_st)); + + if (ptr == NULL) return NULL; memset(ptr, 0, sizeof(memcached_result_st)); ptr->is_allocated= MEMCACHED_ALLOCATED;