X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fresult.cc;h=444a75f4135091b88589c925eb4f76f4e76dac35;hb=3998b1125e1b9f8ebd2c963aa6f8d60131bc97c4;hp=851337f30facf159c5fe0b59fbbd43587f44bc30;hpb=28adf7b936c6f5c25b7526ff56ec1256da1246d4;p=m6w6%2Flibmemcached diff --git a/libmemcached/result.cc b/libmemcached/result.cc index 851337f3..444a75f4 100644 --- a/libmemcached/result.cc +++ b/libmemcached/result.cc @@ -52,6 +52,7 @@ static inline void _result_init(memcached_result_st *self, self->key_length= 0; self->item_cas= 0; self->root= memc; + self->numeric_value= UINT64_MAX; self->count= 0; self->item_key[0]= 0; } @@ -68,7 +69,7 @@ memcached_result_st *memcached_result_create(const memcached_st *memc, } else { - ptr= static_cast(libmemcached_malloc(memc, sizeof(memcached_result_st))); + ptr= libmemcached_xmalloc(memc, memcached_result_st); if (not ptr) { @@ -97,14 +98,18 @@ void memcached_result_reset(memcached_result_st *ptr) ptr->item_flags= 0; ptr->item_cas= 0; ptr->item_expiration= 0; + ptr->numeric_value= UINT64_MAX; } void memcached_result_free(memcached_result_st *ptr) { - if (not ptr) + if (ptr == NULL) + { return; + } memcached_string_free(&ptr->value); + ptr->numeric_value= UINT64_MAX; if (memcached_is_allocated(ptr)) {