don't leak on xferext ivr event, CID:1214232 Resource leak

This commit is contained in:
Michael Jerris 2014-05-16 14:50:18 +00:00
parent 65d9cf62c9
commit 269db09015
1 changed files with 9 additions and 6 deletions

View File

@ -696,13 +696,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
if (!strcasecmp(hp->name, "application")) {
app = strdup(hp->value);
data = strchr(app, ' ');
if (data) {
*data++ = '\0';
if (app) {
data = strchr(app, ' ');
if (data) {
*data++ = '\0';
}
switch_caller_extension_add_application(session, extension, app, data);
free(app);
}
switch_caller_extension_add_application(session, extension, app, data);
}
}