X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fbin%2Fmemflush.cc;h=49d691b8ed7320de626eb36b5c7f03252494280c;hb=60ae98b26965ead9238783c494c8b0d29f8e8d79;hp=8cd933ff132da914db2755cbad02c88de895350b;hpb=5bb6f975322d3da0caf082b8d890132194d0a4ea;p=m6w6%2Flibmemcached diff --git a/src/bin/memflush.cc b/src/bin/memflush.cc index 8cd933ff..49d691b8 100644 --- a/src/bin/memflush.cc +++ b/src/bin/memflush.cc @@ -59,9 +59,12 @@ int main(int argc, char *argv[]) if (servers == NULL or memcached_server_list_count(servers) == 0) { std::cerr << "Invalid server list provided:" << opt_servers << std::endl; + free(opt_servers); return EXIT_FAILURE; } + free(opt_servers); + memcached_st *memc= memcached_create(NULL); memcached_server_push(memc, servers); memcached_server_list_free(servers); @@ -90,12 +93,11 @@ int main(int argc, char *argv[]) if (rc != MEMCACHED_SUCCESS) { std::cerr << memcached_last_error_message(memc) << std::endl; + memcached_free(memc); + return EXIT_FAILURE; } memcached_free(memc); - - free(opt_servers); - return EXIT_SUCCESS; }