projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Deprecate MEMCACHED_NO_KEY_PROVIDED, and fixed key validation tests for the binary...
[m6w6/libmemcached]
/
libmemcached
/
memcached_result.c
diff --git
a/libmemcached/memcached_result.c
b/libmemcached/memcached_result.c
index 0860e792e528f6ae3de02b725e03a8ce27454fa2..8d376f680fd45ced6ef1cd6a88b4f3f21ed19666 100644
(file)
--- a/
libmemcached/memcached_result.c
+++ b/
libmemcached/memcached_result.c
@@
-11,10
+11,7
@@
memcached_result_st *memcached_result_create(memcached_st *memc,
{
/* Saving malloc calls :) */
if (ptr)
{
/* Saving malloc calls :) */
if (ptr)
- {
memset(ptr, 0, sizeof(memcached_result_st));
memset(ptr, 0, sizeof(memcached_result_st));
- ptr->is_allocated= MEMCACHED_NOT_ALLOCATED;
- }
else
{
if (memc->call_malloc)
else
{
if (memc->call_malloc)
@@
-25,13
+22,12
@@
memcached_result_st *memcached_result_create(memcached_st *memc,
if (ptr == NULL)
return NULL;
memset(ptr, 0, sizeof(memcached_result_st));
if (ptr == NULL)
return NULL;
memset(ptr, 0, sizeof(memcached_result_st));
- ptr->is_allocated=
MEMCACHED_ALLOCATED
;
+ ptr->is_allocated=
true
;
}
ptr->root= memc;
memcached_string_create(memc, &ptr->value, 0);
WATCHPOINT_ASSERT(ptr->value.string == NULL);
}
ptr->root= memc;
memcached_string_create(memc, &ptr->value, 0);
WATCHPOINT_ASSERT(ptr->value.string == NULL);
- WATCHPOINT_ASSERT(ptr->value.is_allocated == MEMCACHED_NOT_ALLOCATED);
return ptr;
}
return ptr;
}
@@
-60,8
+56,6
@@
void memcached_result_free(memcached_result_st *ptr)
memcached_string_free(&ptr->value);
memcached_string_free(&ptr->value);
- if (ptr->is_allocated
== MEMCACHED_ALLOCATED
)
+ if (ptr->is_allocated)
free(ptr);
free(ptr);
- else
- ptr->is_allocated= MEMCACHED_USED;
}
}