TT#9301 remove already applied upstream patches

Change-Id: I40b30559fd65444ecd09c7289af5a46ca91d8cef
changes/29/11029/1
Victor Seva 9 years ago
parent 431c151165
commit 16a4f270d1

@ -1,7 +1,6 @@
##
# upstream fixes
# 4.4
upstream/dialplan-fix-avp-values-when-using-PV_IDX_ITR.patch
#
# upsream fixes from master
upstream/pv-new-function-pv_evalx-dst-fmt.patch

@ -1,63 +0,0 @@
From 30f53f1484144d2069f5d3724a65e160bbb6adb5 Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 15 Dec 2016 09:33:45 +0100
Subject: [PATCH] dialplan: fix avp values when using PV_IDX_ITR
manual backport from cc2c3de5e859861b59265cc5a0d41ae968a08149
---
modules/dialplan/dp_repl.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/modules/dialplan/dp_repl.c b/modules/dialplan/dp_repl.c
index bfeda07..959c4bc 100644
--- a/modules/dialplan/dp_repl.c
+++ b/modules/dialplan/dp_repl.c
@@ -67,9 +67,10 @@ int dpl_dyn_printf_s(sip_msg_t *msg, const pv_elem_p elem,
pv_elem_p e = NULL;
pv_elem_p t = NULL;
str s = STR_NULL;
+ str v = STR_NULL;
int ret = -1;
- if(elem==NULL||avp_elem==NULL||elem_prev==NULL) return -1;
+ if(elem==NULL||avp_elem==NULL||elem_prev==NULL||vexpr==NULL) return -1;
if(str_append(&(avp_elem->text), val, &s)<0) return -1;
if(pv_parse_format(&s, &e)<0) {
@@ -86,10 +87,18 @@ int dpl_dyn_printf_s(sip_msg_t *msg, const pv_elem_p elem,
}
if(*elem_prev) (*elem_prev)->next = e;
e->next = avp_elem->next;
- if(pv_printf_s(msg, e, vexpr)<0){
+ if(pv_printf_s(msg, e, &v)<0){
LM_ERR("cannot get avp pcre dynamic expression value\n");
goto clean;
}
+ /* pv_printf_s uses pv_get_buffer() we do need to copy */
+ vexpr->len = v.len;
+ vexpr->s = pkg_malloc(sizeof(char)*(v.len+1));
+ if(vexpr->s==NULL) {
+ PKG_MEM_ERROR;
+ goto clean;
+ }
+ strcpy(vexpr->s, v.s);
ret = 0;
clean:
if(s.s) pkg_free(s.s);
@@ -282,7 +291,12 @@ error:
}
clean:
if(elem) pv_elem_free_all(elem);
- while(l) { t = l->next; pkg_free(l); l = t;}
+ while(l) {
+ t = l->next;
+ if(l->s.s) pkg_free(l->s.s);
+ pkg_free(l);
+ l = t;
+ }
return re_list;
}
--
2.10.2
Loading…
Cancel
Save