Module: kamailio
Branch: master
Commit: c5cdd8dce66d94f69f773b5361ef2b477df47f06
URL:
https://github.com/kamailio/kamailio/commit/c5cdd8dce66d94f69f773b5361ef2b4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-20T09:31:49+02:00
uid_domain: avoid double free in case of error
---
Modified: src/modules/uid_domain/domain.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c5cdd8dce66d94f69f773b5361ef2b4…
Patch:
https://github.com/kamailio/kamailio/commit/c5cdd8dce66d94f69f773b5361ef2b4…
---
diff --git a/src/modules/uid_domain/domain.c b/src/modules/uid_domain/domain.c
index e654adf321..0c4332a106 100644
--- a/src/modules/uid_domain/domain.c
+++ b/src/modules/uid_domain/domain.c
@@ -244,7 +244,7 @@ int load_domains(domain_t** dest)
list = 0;
- if (db_exec(&res, load_domains_cmd) < 0) {
+ if ((db_exec(&res, load_domains_cmd) < 0) || (res==NULL)) {
ERR("Error while querying database\n");
return -1;
}
@@ -292,6 +292,7 @@ int load_domains(domain_t** dest)
}
db_res_free(res);
+ res = NULL;
if (load_domain_attrs) {
d = list;