1
0
Fork 0

Fixed: double-free in mmsglobalsender

This commit is contained in:
bagyenda 2006-05-22 10:06:22 +00:00
parent cfa26d3c75
commit 1bd576132d
3 changed files with 6 additions and 6 deletions

View File

@ -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);
} }
} }