diff --git a/debian/patches/series b/debian/patches/series index 9aa322b50..57e61baa9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,8 +1,11 @@ # backports from master upstream/acc-allow-pseudo-variables-as-first-parameter-for-fu.patch upstream/acc-add-documentation-note-indicating-the-use-of-pse.patch +upstream/0001-outbound-Fix-memory-leak.patch +upstream/0002-core-parser-Free-rr-correctly-in-error-cases.patch +upstream/0003-parser-rr-free_rr-is-expecting-rr_t-parameter.patch +upstream/0004-debugger-fix-reset_msgid.patch upstream/debug/0001-modules-debugger-trace-msg-out.patch -upstream/debug/0001-debugger-fix-reset_msgid.patch ## multipart bodies upstream/0001-parser-add-internal-flag-FL_BODY_MULTIPART.patch upstream/0001-core-add-str_append-helper-function.patch diff --git a/debian/patches/upstream/0001-outbound-Fix-memory-leak.patch b/debian/patches/upstream/0001-outbound-Fix-memory-leak.patch new file mode 100644 index 000000000..d2c5b6585 --- /dev/null +++ b/debian/patches/upstream/0001-outbound-Fix-memory-leak.patch @@ -0,0 +1,37 @@ +From 6c967cebd213d1820cd1af428db5449b1af9aec1 Mon Sep 17 00:00:00 2001 +From: Hugh Waite +Date: Tue, 12 Aug 2014 19:52:27 +0100 +Subject: [PATCH] outbound: Fix memory leak + +- Free parameters parsed when checking for ob markers +(cherry picked from commit 392689597376eb6f047c12504bcce367f5940260) +--- + modules/outbound/ob_mod.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c +index 038c5fa..aae1e10 100644 +--- a/modules/outbound/ob_mod.c ++++ b/modules/outbound/ob_mod.c +@@ -385,6 +385,8 @@ static int use_outbound_non_reg(struct sip_msg *msg) + LM_ERR("parsing Route-URI parameters\n"); + return 0; + } ++ /* Not interested in param body - just the hooks */ ++ free_params(params); + + if (hooks.uri.ob) + { +@@ -450,6 +452,9 @@ static int use_outbound_non_reg(struct sip_msg *msg) + LM_ERR("parsing Contact-URI parameters\n"); + return 0; + } ++ /* Not interested in param body - just the hooks */ ++ free_params(params); ++ + if (hooks.contact.ob) + { + LM_DBG("found ;ob parameter on Contact-URI - outbound" +-- +2.1.0.rc1 + diff --git a/debian/patches/upstream/0002-core-parser-Free-rr-correctly-in-error-cases.patch b/debian/patches/upstream/0002-core-parser-Free-rr-correctly-in-error-cases.patch new file mode 100644 index 000000000..37f6375ce --- /dev/null +++ b/debian/patches/upstream/0002-core-parser-Free-rr-correctly-in-error-cases.patch @@ -0,0 +1,27 @@ +From 8ce72b602046e39c862c7db7eb885ca4b3ac960c Mon Sep 17 00:00:00 2001 +From: Hugh Waite +Date: Tue, 12 Aug 2014 19:56:45 +0100 +Subject: [PATCH] core/parser: Free rr correctly in error cases + +- Fix potential memory leak if parameters are parsed into rr structure +(cherry picked from commit b40d92962b680ac29dd38ffe3c8f1aa1e39d3a97) +--- + parser/parse_rr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parser/parse_rr.c b/parser/parse_rr.c +index d3a2938..e3df4f3 100644 +--- a/parser/parse_rr.c ++++ b/parser/parse_rr.c +@@ -138,7 +138,7 @@ static inline int do_parse_rr_body(char *buf, int len, rr_t **head) + } + + error: +- if (r) pkg_free(r); ++ if (r) free_rr(r); + free_rr(head); /* Free any contacts created so far */ + return -1; + +-- +2.1.0.rc1 + diff --git a/debian/patches/upstream/0003-parser-rr-free_rr-is-expecting-rr_t-parameter.patch b/debian/patches/upstream/0003-parser-rr-free_rr-is-expecting-rr_t-parameter.patch new file mode 100644 index 000000000..c0d1f1498 --- /dev/null +++ b/debian/patches/upstream/0003-parser-rr-free_rr-is-expecting-rr_t-parameter.patch @@ -0,0 +1,29 @@ +From 1d44d71e1786182df3f81f7abf206e13faae9d26 Mon Sep 17 00:00:00 2001 +From: Daniel-Constantin Mierla +Date: Thu, 14 Aug 2014 18:24:31 +0200 +Subject: [PATCH] parser/rr: free_rr() is expecting rr_t** parameter + +- give the parameter as &r, following the commit + b40d92962b680ac29dd38ffe3c8f1aa1e39d3a97 + +(cherry picked from commit 34ba948cdabf7139c8563e531f18c4a486b31a00) +--- + parser/parse_rr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parser/parse_rr.c b/parser/parse_rr.c +index e3df4f3..0f293eb 100644 +--- a/parser/parse_rr.c ++++ b/parser/parse_rr.c +@@ -138,7 +138,7 @@ static inline int do_parse_rr_body(char *buf, int len, rr_t **head) + } + + error: +- if (r) free_rr(r); ++ if (r) free_rr(&r); + free_rr(head); /* Free any contacts created so far */ + return -1; + +-- +2.1.0.rc1 + diff --git a/debian/patches/upstream/debug/0001-debugger-fix-reset_msgid.patch b/debian/patches/upstream/0004-debugger-fix-reset_msgid.patch similarity index 72% rename from debian/patches/upstream/debug/0001-debugger-fix-reset_msgid.patch rename to debian/patches/upstream/0004-debugger-fix-reset_msgid.patch index 6dcde2ba7..e481db912 100644 --- a/debian/patches/upstream/debug/0001-debugger-fix-reset_msgid.patch +++ b/debian/patches/upstream/0004-debugger-fix-reset_msgid.patch @@ -1,16 +1,20 @@ -From 86f998f6ebc800ca3292d699951427b9c54ced75 Mon Sep 17 00:00:00 2001 +From 2fd085d21fb1a026d31d98541a9e33c568245771 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 19 Aug 2014 17:21:57 +0200 Subject: [PATCH] debugger: fix reset_msgid Don't change the msg->id when that message has been processed already + +(cherry picked from commit 6b2f7d0b9d405d8ffd2310f788254453d6748f0b) --- modules/debugger/debugger_api.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) +diff --git a/modules/debugger/debugger_api.c b/modules/debugger/debugger_api.c +index e6e5f54..39e599b 100644 --- a/modules/debugger/debugger_api.c +++ b/modules/debugger/debugger_api.c -@@ -270,18 +270,18 @@ +@@ -268,18 +268,18 @@ int dbg_msgid_filter(struct sip_msg *msg, unsigned int flags, void *bar) } msgid_base = _dbg_pid_list[indx].msgid_base; lock_release(_dbg_pid_list[indx].lock); @@ -35,3 +39,6 @@ Don't change the msg->id when that message has been processed already } /** +-- +2.1.0.rc1 +