projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge Monty
[awesomized/libmemcached]
/
libmemcached
/
stats.c
diff --git
a/libmemcached/stats.c
b/libmemcached/stats.c
index 6b09e604ec0d969f6bffc18759d4b74f77730273..4f3bdb0d0af548b15fa2465d16feb1c209dba674 100644
(file)
--- a/
libmemcached/stats.c
+++ b/
libmemcached/stats.c
@@
-371,6
+371,8
@@
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_retur
stats= ptr->call_calloc(ptr, ptr->number_of_hosts, sizeof(memcached_stat_st));
stats= ptr->call_calloc(ptr, ptr->number_of_hosts, sizeof(memcached_stat_st));
+ stats->root= ptr;
+
if (!stats)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
if (!stats)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
@@
-451,8
+453,16
@@
void memcached_stat_free(memcached_st *ptr, memcached_stat_st *memc_stat)
return;
}
return;
}
- if (ptr)
+ if (memc_stat->root)
+ {
+ memc_stat->root->call_free(ptr, memc_stat);
+ }
+ else if (ptr)
+ {
ptr->call_free(ptr, memc_stat);
ptr->call_free(ptr, memc_stat);
+ }
else
else
+ {
free(memc_stat);
free(memc_stat);
+ }
}
}