X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fallocators.cc;h=98c87591a53615e496babd67c4b605dd4e4449e6;hb=0302d893ad986b16a186b8b145c08e8599e3804a;hp=cc41f2c37a7bb1adddad5e6c365be07e42fb9409;hpb=0ae14bed70947882f5ee9423dfcb20eeda7acdd9;p=m6w6%2Flibmemcached diff --git a/libmemcached/allocators.cc b/libmemcached/allocators.cc index cc41f2c3..98c87591 100644 --- a/libmemcached/allocators.cc +++ b/libmemcached/allocators.cc @@ -60,7 +60,7 @@ void *_libmemcached_calloc(const memcached_st *self, size_t nelem, size_t size, if (self->allocators.malloc != _libmemcached_malloc) { void *ret = _libmemcached_malloc(self, nelem * size, context); - if (not ret) + if (ret == NULL) { memset(ret, 0, nelem * size); } @@ -90,11 +90,11 @@ memcached_return_t memcached_set_memory_allocators(memcached_st *self, } /* All should be set, or none should be set */ - if (mem_malloc == NULL && mem_free == NULL && mem_realloc == NULL && mem_calloc == NULL) + if (mem_malloc == NULL and mem_free == NULL and mem_realloc == NULL and mem_calloc == NULL) { self->allocators= memcached_allocators_return_default(); } - else if (mem_malloc == NULL || mem_free == NULL || mem_realloc == NULL || mem_calloc == NULL) + else if (mem_malloc == NULL or mem_free == NULL or mem_realloc == NULL or mem_calloc == NULL) { return memcached_set_error(*self, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, memcached_literal_param("NULL parameter provided for one or more allocators")); }