From ca1d51126acacad64ed939fdabf5ed68fed52617 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 31 Dec 2012 21:20:53 -0500 Subject: [PATCH] Update to stats in case of bad function call. --- libmemcached/stats.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libmemcached/stats.cc b/libmemcached/stats.cc index eb337680..6bab673d 100644 --- a/libmemcached/stats.cc +++ b/libmemcached/stats.cc @@ -227,9 +227,21 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, const char *key return MEMCACHED_SUCCESS; } -char *memcached_stat_get_value(const memcached_st *ptr, memcached_stat_st *memc_stat, +char *memcached_stat_get_value(const memcached_st *, memcached_stat_st *memc_stat, const char *key, memcached_return_t *error) { + memcached_return_t not_used; + if (error == NULL) + { + error= ¬_used; + } + + if (memc_stat == NULL) + { + *error= MEMCACHED_INVALID_ARGUMENTS; + return NULL; + } + char buffer[SMALL_STRING_LEN]; int length; -- 2.30.2