+ if (ptr == NULL)
+ return;
+
+ if (ptr->string)
+ {
+ if (ptr->root->call_free)
+ ptr->root->call_free(ptr->root, ptr->string);
+ else
+ free(ptr->string);
+ }
+
+ if (ptr->is_allocated == MEMCACHED_ALLOCATED)
+ {
+ if (ptr->root->call_free)
+ ptr->root->call_free(ptr->root, ptr);
+ else
+ free(ptr);
+ }
+ else
+ ptr->is_allocated= MEMCACHED_USED;