From 628fc0c744bc8c0dd02c2bfc23832b2f936e41ae Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Wed, 12 Oct 2011 10:21:42 +0000 Subject: [PATCH] more mem leak fixes --- mbuni/ChangeLog | 1 + mbuni/mmlib/mms_util.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mbuni/ChangeLog b/mbuni/ChangeLog index 13adc55..9706d20 100644 --- a/mbuni/ChangeLog +++ b/mbuni/ChangeLog @@ -1,5 +1,6 @@ 2011-10-11 P. A. Bagyenda * Fixed mem leaks in mmsc uaprof module + * Fixed mem leak in get_content_type function 2011-10-03 P. A. Bagyenda * Fixed: compilation issue 2011-09-23 P. A. Bagyenda diff --git a/mbuni/mmlib/mms_util.c b/mbuni/mmlib/mms_util.c index 1c7c2da..d328440 100644 --- a/mbuni/mmlib/mms_util.c +++ b/mbuni/mmlib/mms_util.c @@ -2922,7 +2922,8 @@ void get_content_from_sendmms_request(Octstr *body, List *headers, List *cgivars Octstr *reply = NULL, *params = NULL; http_header_add(reqh, "User-Agent", MM_NAME "/" VERSION); - + + *ctype = NULL; if (mms_url_fetch_content(HTTP_METHOD_GET, s, reqh, NULL, &rph, &reply) == HTTP_OK) get_content_type(rph, ctype, ¶ms); else @@ -2935,7 +2936,8 @@ void get_content_from_sendmms_request(Octstr *body, List *headers, List *cgivars http_destroy_headers(reqh); http_destroy_headers(*rh); *rh = rph ? rph : http_create_empty_headers(); /* replace as real reply headers. */ - *ctype = http_header_value(*rh, octstr_imm("Content-Type")); + if (*ctype == NULL) + *ctype = http_header_value(*rh, octstr_imm("Content-Type")); octstr_destroy(params); } else if ((s = http_cgi_variable(cgivars, "content")) != NULL) { /* any content. */ Octstr *_xctype = NULL; /* ... because cgi var stuff is destroyed elsewhere, we must dup it !! */