diff options
author | dormando <dormando@rydia.net> | 2011-07-11 18:39:03 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2011-07-11 18:39:03 -0700 |
commit | 0d45e55dee7b380efccee1859fe6caa4ddace17a (patch) | |
tree | ac81a494d95e881e9ba742292ec8c32b98567e7e | |
parent | ea2d42a50c07b862a465ba7926e9715a945304ef (diff) | |
download | memcached-0d45e55dee7b380efccee1859fe6caa4ddace17a.tar.gz |
must reallocate in incr/decr if item in use
lost this earlier somehow. if item is in flight, don't overwrite it in
place during add_delta.
-rw-r--r-- | memcached.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/memcached.c b/memcached.c index 0d484dc..df1ee7b 100644 --- a/memcached.c +++ b/memcached.c @@ -2868,7 +2868,7 @@ enum delta_result_type do_add_delta(conn *c, const char *key, const size_t nkey, snprintf(buf, INCR_MAX_STORAGE_LEN, "%llu", (unsigned long long)value); res = strlen(buf); - if (res + 2 > it->nbytes) { /* need to realloc */ + if (res + 2 > it->nbytes || it->refcount != 1) { /* need to realloc */ item *new_it; new_it = do_item_alloc(ITEM_key(it), it->nkey, atoi(ITEM_suffix(it) + 1), it->exptime, res + 2 ); if (new_it == 0) { |