[sr-dev] git:master:63a9d4f9: xlog: convert to memory logging helper

Henning Westerholt hw at skalatan.de
Sat Jan 25 19:21:14 CET 2020


Module: kamailio
Branch: master
Commit: 63a9d4f917247e321cd34e9f087af729808767cb
URL: https://github.com/kamailio/kamailio/commit/63a9d4f917247e321cd34e9f087af729808767cb

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2020-01-25T18:43:58+01:00

xlog: convert to memory logging helper

---

Modified: src/modules/xlog/xlog.c

---

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

---

diff --git a/src/modules/xlog/xlog.c b/src/modules/xlog/xlog.c
index 646bf8d258..2909232dc1 100644
--- a/src/modules/xlog/xlog.c
+++ b/src/modules/xlog/xlog.c
@@ -212,7 +212,7 @@ static int mod_init(void)
 	_xlog_buf = (char*)pkg_malloc((buf_size+1)*sizeof(char));
 	if(_xlog_buf==NULL)
 	{
-		LM_ERR("no pkg memory left\n");
+		PKG_MEM_ERROR;
 		return -1;
 	}
 	return 0;
@@ -498,7 +498,7 @@ static int xdbg_fixup_helper(void** param, int param_no, int mode)
 	xm = (xl_msg_t*)pkg_malloc(sizeof(xl_msg_t));
 	if(xm==NULL)
 	{
-		LM_ERR("no more pkg\n");
+		PKG_MEM_ERROR;
 		return -1;
 	}
 	memset(xm, 0, sizeof(xl_msg_t));
@@ -533,7 +533,7 @@ static int xlog_fixup_helper(void** param, int param_no, int mode)
 		xlp = (xl_level_p)pkg_malloc(sizeof(xl_level_t));
 		if(xlp == NULL)
 		{
-			LM_ERR("no more memory\n");
+			PKG_MEM_ERROR;
 			return E_UNSPEC;
 		}
 		memset(xlp, 0, sizeof(xl_level_t));
@@ -592,7 +592,7 @@ static int xlog3_fixup_helper(void** param, int param_no)
 	facility = (int*)pkg_malloc(sizeof(int));
 	if(facility == NULL)
 	{
-		LM_ERR("no more memory\n");
+		PKG_MEM_ERROR;
 		return E_UNSPEC;
 	}
 	*facility = str2facility(s.s);




More information about the sr-dev mailing list