mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-05 02:34:18 +00:00
CID:1214200 Dereference null return value
This commit is contained in:
parent
92c6f3abc5
commit
0469db0305
@ -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);
|
||||||
|
if (p) {
|
||||||
|
free(dynamic_url);
|
||||||
|
dynamic_url = p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(q);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p = switch_mprintf("%s%s", q, r);
|
|
||||||
free(dynamic_url);
|
|
||||||
dynamic_url = p;
|
|
||||||
free(q);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user