Fixed: double-free in mmsglobalsender
This commit is contained in:
parent
cfa26d3c75
commit
1bd576132d
|
@ -36,13 +36,13 @@ static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_
|
||||||
int j, m;
|
int j, m;
|
||||||
|
|
||||||
if (does_prefix_match(settings->local_prefix, phonenum)) {
|
if (does_prefix_match(settings->local_prefix, phonenum)) {
|
||||||
return settings->hostname;
|
return settings->hostname ? octstr_duplicate(settings->hostname) : NULL;
|
||||||
} else if (proxyrelays && list_len(proxyrelays) > 0) /* Step through proxies. */
|
} else if (proxyrelays && list_len(proxyrelays) > 0) /* Step through proxies. */
|
||||||
for (j = 0, m = list_len(proxyrelays); j < m; j++) {
|
for (j = 0, m = list_len(proxyrelays); j < m; j++) {
|
||||||
MmsProxyRelay *mp = list_get(proxyrelays, j);
|
MmsProxyRelay *mp = list_get(proxyrelays, j);
|
||||||
if (does_prefix_match(mp->allowed_prefix, phonenum) &&
|
if (does_prefix_match(mp->allowed_prefix, phonenum) &&
|
||||||
!does_prefix_match(mp->denied_prefix, phonenum)) {
|
!does_prefix_match(mp->denied_prefix, phonenum)) {
|
||||||
return mp->host;
|
return octstr_duplicate(mp->host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
octstr_destroy(mmsc);
|
octstr_destroy(mmsc);
|
||||||
} else /* Search VASP list, see what you can find... */
|
} else /* Search VASP list, see what you can find... */
|
||||||
for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
|
for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
|
||||||
if ((vasp = list_get(settings->vasp_list, j)) != NULL &&
|
if ((vasp = list_get(settings->vasp_list, j)) != NULL &&
|
||||||
|
|
|
@ -407,9 +407,9 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
||||||
free_stuff:
|
free_stuff:
|
||||||
|
|
||||||
if (notify_cmd) /* Inform provisioning server */
|
if (notify_cmd) /* Inform provisioning server */
|
||||||
notify_prov_server(octstr_get_cstr(settings->prov_notify),
|
notify_prov_server(octstr_get_cstr(settings->prov_notify),
|
||||||
h->base_client_addr ? octstr_get_cstr(h->base_client_addr) : "unknown",
|
h->base_client_addr ? octstr_get_cstr(h->base_client_addr) : "unknown",
|
||||||
notify_cmd, notify_arg ? notify_arg : "");
|
notify_cmd, notify_arg ? notify_arg : "");
|
||||||
|
|
||||||
|
|
||||||
http_destroy_headers(rh);
|
http_destroy_headers(rh);
|
||||||
|
|
Loading…
Reference in New Issue