Module: kamailio
Branch: master
Commit: 5418f380ad55618004936102273b72f1f8e36113
URL:
https://github.com/kamailio/kamailio/commit/5418f380ad55618004936102273b72f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-06-30T13:32:18+02:00
domain: use same condition to alloc and free local variable
---
Modified: src/modules/domain/domain.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5418f380ad55618004936102273b72f…
Patch:
https://github.com/kamailio/kamailio/commit/5418f380ad55618004936102273b72f…
---
diff --git a/src/modules/domain/domain.c b/src/modules/domain/domain.c
index 27951c91ab..1dbdd2f5d5 100644
--- a/src/modules/domain/domain.c
+++ b/src/modules/domain/domain.c
@@ -258,7 +258,7 @@ int ki_lookup_domain_prefix(struct sip_msg *_msg, str *_sdomain, str
*_sprefix)
val.s = did;
if(add_avp(flags, name, val) < 0) {
LM_ERR("unable to add a new AVP '%.*s'\n", name.s.len, name.s.s);
- if(_sprefix)
+ if(_sprefix && _sprefix->s)
pkg_free(name.s.s);
return -1;
}