memcached_touch() crashes when expiration=-1 (ASCII only)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
New
|
Undecided
|
Unassigned |
Bug Description
The following snippet gives: Couldn't touch key: MEMORY ALLOCATION FAILURE
#include <libmemcached/
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
//memcached_
memcached_
memcached_st *memc;
memcached_return rc;
char *key = "keystring";
char *value = "keyvalue";
char *retrieved_value;
size_t value_length;
uint32_t flags;
time_t timeout = -1;
memc = memcached_
//rc = memcached_
servers = memcached_
rc = memcached_
if (rc == MEMCACHED_SUCCESS)
fprintf(stderr, "Added server successfully\n");
else
fprintf(stderr, "Couldn't add server: %s\n", memcached_
rc = memcached_set(memc, key, strlen(key), value, strlen(value), (time_t)0, (uint32_t)0);
if (rc == MEMCACHED_SUCCESS)
fprintf(stderr, "Key stored successfully\n");
else
fprintf(stderr, "Couldn't store key: %s\n", memcached_
rc = memcached_
if (rc == MEMCACHED_SUCCESS)
fprintf(stderr, "Key touched successfully\n");
else
fprintf(stderr, "Couldn't touch key: %s\n", memcached_
return 0;
}
If you uncomment the memcached_