[sr-dev] git:master:0903f5d6: xmlops: add missing memory error log message, convert to memory logging helper

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


Module: kamailio
Branch: master
Commit: 0903f5d65a8d16d4b6b9fddd0bc98cd5da35fb0b
URL: https://github.com/kamailio/kamailio/commit/0903f5d65a8d16d4b6b9fddd0bc98cd5da35fb0b

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

xmlops: add missing memory error log message, convert to memory logging helper

---

Modified: src/modules/xmlops/pv_xml.c

---

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

---

diff --git a/src/modules/xmlops/pv_xml.c b/src/modules/xmlops/pv_xml.c
index 872fea0de3..5fa92c78b0 100644
--- a/src/modules/xmlops/pv_xml.c
+++ b/src/modules/xmlops/pv_xml.c
@@ -82,7 +82,7 @@ pv_xml_t *pv_xml_get_struct(str *name)
 	it = (pv_xml_t*)pkg_malloc(sizeof(pv_xml_t)+2*(pv_xml_buf_size+1));
 	if(it==NULL)
 	{
-		LM_ERR("no more pkg\n");
+		PKG_MEM_ERROR;
 		return NULL;
 	}
 	memset(it, 0, sizeof(pv_xml_t)+2*(pv_xml_buf_size+1));
@@ -444,8 +444,10 @@ int pv_parse_xml_name(pv_spec_p sp, str *in)
 		return -1;
 
 	pxs = (pv_xml_spec_t*)pkg_malloc(sizeof(pv_xml_spec_t));
-	if(pxs==NULL)
+	if(pxs==NULL) {
+		PKG_MEM_ERROR;
 		return -1;
+	}
 
 	memset(pxs, 0, sizeof(pv_xml_spec_t));
 
@@ -519,7 +521,7 @@ int pv_xml_ns_param(modparam_t type, void *val)
 
 	if(ns==NULL)
 	{
-		LM_ERR("no more pkg\n");
+		PKG_MEM_ERROR;
 		goto error;
 	}
 	memset(ns, 0, sizeof(param_t));




More information about the sr-dev mailing list