Module: kamailio
Branch: master
Commit: 614b6b05028ea8d364f7acb95a6367f7c9ea1a6d
URL: 
https://github.com/kamailio/kamailio/commit/614b6b05028ea8d364f7acb95a6367f7c9ea1a6d

Author: Alex Hermann <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2019-02-05T21:11:03+01:00

dispatcher: Fix memleak in destination attributes

---

Modified: src/modules/dispatcher/dispatch.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/614b6b05028ea8d364f7acb95a6367f7c9ea1a6d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/614b6b05028ea8d364f7acb95a6367f7c9ea1a6d.patch

---

diff --git a/src/modules/dispatcher/dispatch.c 
b/src/modules/dispatcher/dispatch.c
index 4956623cc7..072869010e 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -461,6 +461,8 @@ ds_dest_t *pack_dest(str iuri, int flags, int priority, str 
*attrs)
        if(dp != NULL) {
                if(dp->uri.s != NULL)
                        shm_free(dp->uri.s);
+               if(dp->attrs.body.s != NULL)
+                       shm_free(dp->attrs.body.s);
                shm_free(dp);
        }
 
@@ -517,6 +519,8 @@ int add_dest2list(int id, str uri, int flags, int priority, 
str *attrs,
        if(dp != NULL) {
                if(dp->uri.s != NULL)
                        shm_free(dp->uri.s);
+               if(dp->attrs.body.s != NULL)
+                       shm_free(dp->attrs.body.s);
                shm_free(dp);
        }
 
@@ -3306,6 +3310,10 @@ void ds_avl_destroy(ds_set_t **node_ptr)
                        shm_free(dest->uri.s);
                        dest->uri.s = NULL;
                }
+               if (dest->attrs.body.s != NULL) {
+                       shm_free(dest->attrs.body.s);
+                       dest->attrs.body.s = NULL;
+               }
        }
        if(node->dlist != NULL)
                shm_free(node->dlist);


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to