CID:1214200 Dereference null return value

This commit is contained in:
Michael Jerris 2014-05-15 13:47:24 +00:00
parent 92c6f3abc5
commit 0469db0305

View File

@ -1499,12 +1499,17 @@ static switch_status_t httapi_sync(client_t *client)
char *r, *q, *p = strstr(dynamic_url, "://");
use_url++;
if (p) {
dup_creds = strdup(p+3);
if ((q = strchr(dup_creds, '@'))) *q = '\0';
q = strdup(url);
if (q) {
r = strchr(q, '@');
if (r) {
r++;
if ((p = strstr(q, "://"))) {
@ -1512,10 +1517,15 @@ static switch_status_t httapi_sync(client_t *client)
}
p = switch_mprintf("%s%s", q, r);
if (p) {
free(dynamic_url);
dynamic_url = p;
}
}
free(q);
}
}
}
if ((use_url = strchr(dynamic_url, '@'))) {