use switch_goto_status (neato)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12877 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Rupa Schomaker 2009-04-01 21:27:31 +00:00
parent 5aee290d26
commit c15866847c

View File

@ -141,6 +141,7 @@ static switch_status_t do_config(switch_bool_t reload)
SWITCH_STANDARD_API(memcache_function) SWITCH_STANDARD_API(memcache_function)
{ {
switch_status_t status;
char *argv[5] = { 0 }; char *argv[5] = { 0 };
int argc; int argc;
char *subcmd = NULL; char *subcmd = NULL;
@ -301,22 +302,21 @@ SWITCH_STANDARD_API(memcache_function)
goto usage; goto usage;
} }
} }
switch_goto_status(SWITCH_STATUS_SUCCESS, done);
usage:
stream->write_function(stream, "-ERR\n%s\n", SYNTAX);
switch_goto_status(SWITCH_STATUS_SUCCESS, done);
done:
if (memcached) { if (memcached) {
memcached_quit(memcached); memcached_quit(memcached);
memcached_free(memcached); memcached_free(memcached);
} }
switch_safe_free(mydata); switch_safe_free(mydata);
switch_safe_free(stat); switch_safe_free(stat);
return SWITCH_STATUS_SUCCESS;
usage: return status;
if (memcached) {
memcached_quit(memcached);
memcached_free(memcached);
}
switch_safe_free(mydata);
stream->write_function(stream, "-ERR\n%s\n", SYNTAX);
return SWITCH_STATUS_SUCCESS;
} }
/* Macro expands to: switch_status_t mod_memcache_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */ /* Macro expands to: switch_status_t mod_memcache_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */