Browse code

pua_usrloc: convert to PKG/SHM memory logging helper functions

(cherry picked from commit be07ed5dd927448ffad3bd77f976249a888cfb2e)

Victor Seva authored on 29/07/2020 11:10:04
Showing 1 changed files
... ...
@@ -174,7 +174,7 @@ str* build_pidf(ucontact_t* c)
174 174
 	body = (str*)pkg_malloc(sizeof(str));
175 175
 	if(body == NULL)
176 176
 	{
177
-		LM_ERR("while allocating memory\n");
177
+		PKG_MEM_ERROR;
178 178
 		return NULL;
179 179
 	}
180 180
 	memset(body, 0, sizeof(str));
... ...
@@ -253,8 +253,10 @@ void ul_publish(ucontact_t* c, int type, void* param)
253 253
 		body = NULL;
254 254
 
255 255
 	uri.s = (char*)pkg_malloc(sizeof(char)*(c->aor->len+default_domain.len+6));
256
-	if(uri.s == NULL)
256
+	if(uri.s == NULL) {
257
+		PKG_MEM_ERROR;
257 258
 		goto error;
259
+	}
258 260
 
259 261
 	memcpy(uri.s, "sip:", 4);
260 262
 	uri.len = 4;
... ...
@@ -278,7 +280,7 @@ void ul_publish(ucontact_t* c, int type, void* param)
278 280
 	publ= (publ_info_t*)pkg_malloc(size);
279 281
 	if(publ== NULL)
280 282
 	{
281
-		LM_ERR("no more share memory\n");
283
+		SHM_MEM_ERROR;
282 284
 		goto error;
283 285
 	}
284 286
 	memset(publ, 0, size);