Module: kamailio
Branch: master
Commit: 57503311555f5ffcda1c4e3b05df4248558ef50b
URL:
https://github.com/kamailio/kamailio/commit/57503311555f5ffcda1c4e3b05df424…
Author: Claudiu Boriga <paul.boriga(a)1and1.ro>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-01T10:36:01+02:00
carrierroute: check pointer before dereferencing it
---
Modified: src/modules/carrierroute/cr_config.c
---
Diff:
https://github.com/kamailio/kamailio/commit/57503311555f5ffcda1c4e3b05df424…
Patch:
https://github.com/kamailio/kamailio/commit/57503311555f5ffcda1c4e3b05df424…
---
diff --git a/src/modules/carrierroute/cr_config.c b/src/modules/carrierroute/cr_config.c
index ba55eb8fba..2d1af1ecfe 100644
--- a/src/modules/carrierroute/cr_config.c
+++ b/src/modules/carrierroute/cr_config.c
@@ -250,14 +250,14 @@ int load_config(struct route_data_t * rd) {
/* Create and insert carrier data structure */
tmp_carrier_data = create_carrier_data(1, &rd->carrier_map[0].name,
allocated_domain_num);
- tmp_carrier_data->domain_num = 0;
- tmp_carrier_data->id = 1;
- tmp_carrier_data->name = &(rd->carrier_map[0].name);
-
if (tmp_carrier_data == NULL) {
LM_ERR("can't create new carrier\n");
goto errclose;
}
+ tmp_carrier_data->domain_num = 0;
+ tmp_carrier_data->id = 1;
+ tmp_carrier_data->name = &(rd->carrier_map[0].name);
+
if (add_carrier_data(rd, tmp_carrier_data) < 0) {
LM_ERR("couldn't add carrier data\n");
destroy_carrier_data(tmp_carrier_data);