projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Added tag 0.29 for changeset ddaa6a4bb80f
[m6w6/libmemcached]
/
clients
/
memstat.c
diff --git
a/clients/memstat.c
b/clients/memstat.c
index 70028f6b353167f482a6e5f31c9d397c997100a3..f3ac9fe13c125e7ff6064646b14c021631532185 100644
(file)
--- a/
clients/memstat.c
+++ b/
clients/memstat.c
@@
-1,3
+1,4
@@
+#include "libmemcached/common.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@@
-6,6
+7,7
@@
#include <fcntl.h>
#include <string.h>
#include <getopt.h>
#include <fcntl.h>
#include <string.h>
#include <getopt.h>
+#include <sys/time.h>
#include <libmemcached/memcached.h>
#include <libmemcached/memcached.h>
@@
-134,9
+136,12
@@
static void run_analyzer(memcached_st *memc, memcached_stat_st *stat,
if((servers[x]= memcached_create(NULL)) == NULL)
{
fprintf(stderr, "Failed to memcached_create()\n");
if((servers[x]= memcached_create(NULL)) == NULL)
{
fprintf(stderr, "Failed to memcached_create()\n");
+ if (x > 0)
+ memcached_free(servers[0]);
x--;
x--;
- for (; x >
=
0; x--)
+ for (; x > 0; x--)
memcached_free(servers[x]);
memcached_free(servers[x]);
+
free(servers);
return;
}
free(servers);
return;
}