0.11
* Added option to memcache_behavior_set() so that poll() can be timed out.
+ * Fixed memory leak in case of using memcached_fetch_result() where no
+ value was returned.
0.10 Tue Nov 20 23:22:31 PST 2007
* Added append binary test.
memcached_return *error);
/* Server Public functions */
-#define memcached_server_count(A) A->number_of_hosts
-#define memcached_server_name(A,B) B.hostname
-#define memcached_server_port(A,B) B.port
-#define memcached_server_list(A) A->hosts
-#define memcached_server_response_count(A,B) A->hosts[B].stack_responses
+#define memcached_server_count(A) (A)->number_of_hosts
+#define memcached_server_name(A,B) (B).hostname
+#define memcached_server_port(A,B) (B).port
+#define memcached_server_list(A) (A)->hosts
+#define memcached_server_response_count(A,B) (A)->hosts[B].stack_responses
memcached_return memcached_server_add_udp(memcached_st *ptr,
char *hostname,
}
else if (*error == MEMCACHED_END && memcached_string_length((memcached_string_st *)(&result->value)) == 0)
{
- return NULL;
+ goto error;
}
else if (*error == MEMCACHED_END)
{
WATCHPOINT_ASSERT(0); /* If this happens we have somehow messed up the fetch */
- return NULL;
+ goto error;
}
else if (*error != MEMCACHED_SUCCESS)
{
- return NULL;
+ goto error;
}
else
{
}
+error:
+ memcached_result_free(result);
+
return NULL;
}