summaryrefslogtreecommitdiff
path: root/libmemcached/stats.cc
diff options
context:
space:
mode:
authorBrian Aker <brian@tangent.org>2012-12-31 21:20:53 -0500
committerBrian Aker <brian@tangent.org>2012-12-31 21:20:53 -0500
commitca1d51126acacad64ed939fdabf5ed68fed52617 (patch)
tree633b4c1e64e23c8d424b3549c577c8650d486834 /libmemcached/stats.cc
parent543d6be67139ee7cb47c0c8e7d383743f4e68857 (diff)
downloadlibmemcached-ca1d51126acacad64ed939fdabf5ed68fed52617.tar.gz
Update to stats in case of bad function call.
Diffstat (limited to 'libmemcached/stats.cc')
-rw-r--r--libmemcached/stats.cc14
1 files changed, 13 insertions, 1 deletions
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= &not_used;
+ }
+
+ if (memc_stat == NULL)
+ {
+ *error= MEMCACHED_INVALID_ARGUMENTS;
+ return NULL;
+ }
+
char buffer[SMALL_STRING_LEN];
int length;