提交 119d01f6 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix small mem leak in util func

上级 ac77c768
...@@ -1062,8 +1062,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a, ...@@ -1062,8 +1062,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
int var_count = 0; int var_count = 0;
char *next; char *next;
vdata = strdup(data); vdatap = strdup(data);
vdatap = vdata; vdata = vdatap;
end = switch_find_end_paren(vdata, a, b); end = switch_find_end_paren(vdata, a, b);
...@@ -1081,7 +1081,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a, ...@@ -1081,7 +1081,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
vdata++; vdata++;
*end++ = '\0'; *end++ = '\0';
} else { } else {
vdata = NULL; free(vdatap);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论