Module: kamailio
Branch: master
Commit: 6492a6f905075fa73d911c345fe784f2d3c085e5
URL: 
https://github.com/kamailio/kamailio/commit/6492a6f905075fa73d911c345fe784f2d3c085e5

Author: Henning Westerholt <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2023-03-29T09:50:20Z

pike: use pkg_malloc/pkg_free instead of system malloc

---

Modified: src/modules/pike/pike_top.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/6492a6f905075fa73d911c345fe784f2d3c085e5.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6492a6f905075fa73d911c345fe784f2d3c085e5.patch

---

diff --git a/src/modules/pike/pike_top.c b/src/modules/pike/pike_top.c
index 6940e84ca6..c7894604b6 100644
--- a/src/modules/pike/pike_top.c
+++ b/src/modules/pike/pike_top.c
@@ -79,10 +79,10 @@ int pike_top_add_entry( unsigned char *ip_addr, int 
addr_len,
                unsigned int expires, pike_node_status_t status )
 {
        struct TopListItem_t *new_item
-                               = (struct TopListItem_t *)malloc(sizeof(struct 
TopListItem_t));
+                               = (struct TopListItem_t 
*)pkg_malloc(sizeof(struct TopListItem_t));
        if(!new_item)
        {
-               SYS_MEM_ERROR;
+               PKG_MEM_ERROR;
                return -1;
        }
        print_addr(ip_addr, addr_len);
@@ -119,7 +119,7 @@ void pike_top_list_clear()
        top_list_iter = top_list_root;
        while (top_list_iter) {
                ptr = top_list_iter->next;
-               free(top_list_iter);
+               pkg_free(top_list_iter);
                top_list_iter = ptr;
        }
        top_list_root = 0;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to