Module: kamailio
Branch: master
Commit: 9a6182fa8b535bc19c43e905d6b6a110b0e830d2
URL:
https://github.com/kamailio/kamailio/commit/9a6182fa8b535bc19c43e905d6b6a11…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-04T12:17:54+02:00
avp: return in case of error in avp select
---
Modified: src/modules/avp/avp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9a6182fa8b535bc19c43e905d6b6a11…
Patch:
https://github.com/kamailio/kamailio/commit/9a6182fa8b535bc19c43e905d6b6a11…
---
diff --git a/src/modules/avp/avp.c b/src/modules/avp/avp.c
index 40640dfc40..47c775facb 100644
--- a/src/modules/avp/avp.c
+++ b/src/modules/avp/avp.c
@@ -1596,7 +1596,7 @@ static int select_attr_fixup(str* res, select_t* s, struct sip_msg*
msg)
if (! msg) { /* fixup call */
str attr_name;
-
+
if (s->params[SEL_PARAM_IDX].type != SEL_PARAM_STR) {
ERR("attribute name expected.\n");
return -1;
@@ -1619,6 +1619,7 @@ static int select_attr_fixup(str* res, select_t* s, struct sip_msg*
msg)
if (parse_avp_ident(&attr_name, avp_ident) < 0) {
ERR("failed to parse attribute name: `%.*s'.\n",
STR_FMT(&attr_name));
pkg_free(avp_ident);
+ return -1;
}
s->params[SEL_PARAM_IDX].v.p = avp_ident;
s->params[SEL_PARAM_IDX].type = SEL_PARAM_PTR;