[sr-dev] git:5.4:b5d848e7: pua_usrloc: convert to PKG/SHM memory logging helper functions

Victor Seva linuxmaniac at torreviejawireless.org
Sat Aug 1 10:44:49 CEST 2020


Module: kamailio
Branch: 5.4
Commit: b5d848e774814b0673c4fec1734d6f3de3e1c877
URL: https://github.com/kamailio/kamailio/commit/b5d848e774814b0673c4fec1734d6f3de3e1c877

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2020-08-01T10:42:53+02:00

pua_usrloc: convert to PKG/SHM memory logging helper functions

(cherry picked from commit be07ed5dd927448ffad3bd77f976249a888cfb2e)

---

Modified: src/modules/pua_usrloc/ul_publish.c

---

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

---

diff --git a/src/modules/pua_usrloc/ul_publish.c b/src/modules/pua_usrloc/ul_publish.c
index 0afd6d4201..cb8af0c7fa 100644
--- a/src/modules/pua_usrloc/ul_publish.c
+++ b/src/modules/pua_usrloc/ul_publish.c
@@ -174,7 +174,7 @@ str* build_pidf(ucontact_t* c)
 	body = (str*)pkg_malloc(sizeof(str));
 	if(body == NULL)
 	{
-		LM_ERR("while allocating memory\n");
+		PKG_MEM_ERROR;
 		return NULL;
 	}
 	memset(body, 0, sizeof(str));
@@ -253,8 +253,10 @@ void ul_publish(ucontact_t* c, int type, void* param)
 		body = NULL;
 
 	uri.s = (char*)pkg_malloc(sizeof(char)*(c->aor->len+default_domain.len+6));
-	if(uri.s == NULL)
+	if(uri.s == NULL) {
+		PKG_MEM_ERROR;
 		goto error;
+	}
 
 	memcpy(uri.s, "sip:", 4);
 	uri.len = 4;
@@ -278,7 +280,7 @@ void ul_publish(ucontact_t* c, int type, void* param)
 	publ= (publ_info_t*)pkg_malloc(size);
 	if(publ== NULL)
 	{
-		LM_ERR("no more share memory\n");
+		SHM_MEM_ERROR;
 		goto error;
 	}
 	memset(publ, 0, size);




More information about the sr-dev mailing list