From: Brian Aker Date: Tue, 8 Apr 2008 15:16:00 +0000 (-0700) Subject: Removed issue around zero length returns now being valid. Fixed memory leak X-Git-Tag: 0.20~1^2~22 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7ccdd868f4869dce7dce49ca8f5eaa969e4e74a2;p=awesomized%2Flibmemcached Removed issue around zero length returns now being valid. Fixed memory leak in test case (test case is new to this version). --- diff --git a/libmemcached/memcached_storage.c b/libmemcached/memcached_storage.c index 3645952a..c9aa8722 100644 --- a/libmemcached/memcached_storage.c +++ b/libmemcached/memcached_storage.c @@ -47,9 +47,6 @@ memcached_return memcached_send(memcached_st *ptr, char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE]; unsigned int server_key; - WATCHPOINT_ASSERT(!(value == NULL && value_length > 0)); - WATCHPOINT_ASSERT(!(value && value_length == 0)); - unlikely (key_length == 0) return MEMCACHED_NO_KEY_PROVIDED; diff --git a/tests/function.c b/tests/function.c index 03df4da2..a08e1eaa 100644 --- a/tests/function.c +++ b/tests/function.c @@ -620,6 +620,7 @@ uint8_t read_through(memcached_st *memc) assert(rc == MEMCACHED_SUCCESS); assert(string_length == strlen(READ_THROUGH_VALUE)); assert(!strcmp(READ_THROUGH_VALUE, string)); + free(string); string= memcached_get(memc, key, strlen(key), &string_length, &flags, &rc); @@ -627,6 +628,7 @@ uint8_t read_through(memcached_st *memc) assert(rc == MEMCACHED_SUCCESS); assert(string_length == strlen(READ_THROUGH_VALUE)); assert(!strcmp(READ_THROUGH_VALUE, string)); + free(string); return 0; } @@ -1950,8 +1952,6 @@ uint8_t user_supplied_bug14(memcached_st *memc) &string_length, &flags, &rc); assert(rc == MEMCACHED_SUCCESS); - if (current_length > 0) - assert(string); assert(string_length == current_length); assert(!memcmp(string, value, string_length));