Module: kamailio Branch: master Commit: be07ed5dd927448ffad3bd77f976249a888cfb2e URL: https://github.com/kamailio/kamailio/commit/be07ed5dd927448ffad3bd77f976249a...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2020-07-29T13:10:04+02:00
pua_usrloc: convert to PKG/SHM memory logging helper functions
---
Modified: src/modules/pua_usrloc/ul_publish.c
---
Diff: https://github.com/kamailio/kamailio/commit/be07ed5dd927448ffad3bd77f976249a... Patch: https://github.com/kamailio/kamailio/commit/be07ed5dd927448ffad3bd77f976249a...
---
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);