提交 0469db03 authored 作者: Michael Jerris's avatar Michael Jerris

CID:1214200 Dereference null return value

上级 92c6f3ab
...@@ -1499,22 +1499,32 @@ static switch_status_t httapi_sync(client_t *client) ...@@ -1499,22 +1499,32 @@ static switch_status_t httapi_sync(client_t *client)
char *r, *q, *p = strstr(dynamic_url, "://"); char *r, *q, *p = strstr(dynamic_url, "://");
use_url++; use_url++;
dup_creds = strdup(p+3); if (p) {
dup_creds = strdup(p+3);
if ((q = strchr(dup_creds, '@'))) *q = '\0'; if ((q = strchr(dup_creds, '@'))) *q = '\0';
q = strdup(url); q = strdup(url);
r = strchr(q, '@');
r++;
if ((p = strstr(q, "://"))) { if (q) {
*(p+3) = '\0'; r = strchr(q, '@');
}
if (r) {
r++;
if ((p = strstr(q, "://"))) {
*(p+3) = '\0';
}
p = switch_mprintf("%s%s", q, r); p = switch_mprintf("%s%s", q, r);
free(dynamic_url); if (p) {
dynamic_url = p; free(dynamic_url);
free(q); dynamic_url = p;
}
}
free(q);
}
}
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论