[sr-dev] git:master:5418f380: domain: use same condition to alloc and free local variable
Daniel-Constantin Mierla
miconda at gmail.com
Fri Jun 30 14:16:57 CEST 2017
Module: kamailio
Branch: master
Commit: 5418f380ad55618004936102273b72f1f8e36113
URL: https://github.com/kamailio/kamailio/commit/5418f380ad55618004936102273b72f1f8e36113
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/5418f380ad55618004936102273b72f1f8e36113.diff
Patch: https://github.com/kamailio/kamailio/commit/5418f380ad55618004936102273b72f1f8e36113.patch
---
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;
}
More information about the sr-dev
mailing list