1
0
Fork 0

Improvements to mmsproxy (do not free NULL Octstr)

This commit is contained in:
bagyenda 2005-09-22 07:03:26 +00:00
parent 189e6e8b73
commit c5c0cab256
1 changed files with 22 additions and 15 deletions

View File

@ -715,12 +715,13 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
sscanf(octstr_get_cstr(s), "%d", &n);
octstr_destroy(s);
}
s = octstr_format("%d%S", n+1, pdate);
mms_replace_header_value(mfwd,
"X-Mms-Previously-Sent-Date",
octstr_get_cstr(s));
octstr_destroy(pdate);
if (pdate) {
s = octstr_format("%d%S", n+1, pdate);
mms_replace_header_value(mfwd,
"X-Mms-Previously-Sent-Date",
octstr_get_cstr(s));
octstr_destroy(pdate);
}
if (delivery_report &&
octstr_case_compare(delivery_report, octstr_imm("Yes")) == 0)
dlr = 1;
@ -822,13 +823,16 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
0,
octstr_get_cstr(settings->global_queuedir),
settings->host_alias);
octstr_destroy(x);
if (x)
octstr_destroy(x);
list_destroy(l, NULL);
mms_destroy(mrep);
}
octstr_destroy(pfrom);
octstr_destroy(pdelivery_report);
if (pfrom)
octstr_destroy(pfrom);
if (pdelivery_report)
octstr_destroy(pdelivery_report);
if (pmsgid)
octstr_destroy(pmsgid);
@ -942,7 +946,8 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
0,
octstr_get_cstr(settings->global_queuedir),
settings->host_alias);
octstr_destroy(x);
if (x)
octstr_destroy(x);
list_destroy(l, (list_item_destructor_t *)octstr_destroy);
mms_destroy(mrpt);
@ -999,7 +1004,8 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
/* Log to access log */
mms_log("ReadReport", h->client_addr, NULL, msize, NULL, NULL, NULL, "MM1", h->ua,NULL);
octstr_destroy(x);
if (x)
octstr_destroy(x);
mdone2:
@ -1581,7 +1587,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert);
m = mm7_soap_to_mmsmsg(mreq, sender);
if (m) {
Octstr *value;
Octstr *value = NULL;
int dlr;
value = mms_get_header_value(m, octstr_imm("X-Mms-Delivery-Report"));
@ -1606,9 +1612,10 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
octstr_get_cstr(settings->global_queuedir),
settings->host_alias);
msgid = mms_maketransid(octstr_get_cstr(qf), settings->host_alias);
mms_log("Received", sender, to, -1, msgid, h->vasp->id, NULL, "MM7", h->ua, NULL);
octstr_destroy(value);
mms_log("Received", sender, to, -1, msgid, h->vasp->id, NULL, "MM7",
h->ua, NULL);
if (value)
octstr_destroy(value);
} else
status = 4001;
mresp = mm7_make_resp(mreq, status, msgid);