提交 8021f11d authored 作者: Brian West's avatar Brian West

fix leak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13446 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 ee0fd0d3
...@@ -1099,7 +1099,7 @@ SWITCH_STANDARD_API(strftime_api_function) ...@@ -1099,7 +1099,7 @@ SWITCH_STANDARD_API(strftime_api_function)
SWITCH_STANDARD_API(presence_api_function) SWITCH_STANDARD_API(presence_api_function)
{ {
switch_event_t *event; switch_event_t *event;
char *lbuf, *argv[4]; char *lbuf = NULL , *argv[4];
int argc = 0; int argc = 0;
switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN; switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN;
int need = 4; int need = 4;
...@@ -1138,18 +1138,18 @@ SWITCH_STANDARD_API(presence_api_function) ...@@ -1138,18 +1138,18 @@ SWITCH_STANDARD_API(presence_api_function)
switch_event_fire(&event); switch_event_fire(&event);
} }
stream->write_function(stream, "Event Sent"); stream->write_function(stream, "Event Sent");
switch_safe_free(lbuf);
} else { } else {
goto error; goto error;
} }
switch_safe_free(lbuf);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
error: error:
switch_safe_free(lbuf);
stream->write_function(stream, "Invalid: presence %s", PRESENCE_USAGE); stream->write_function(stream, "Invalid: presence %s", PRESENCE_USAGE);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_STANDARD_API(chat_api_function) SWITCH_STANDARD_API(chat_api_function)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论