Skip to content

Commit

Permalink
pua_usrloc: convert to PKG/SHM memory logging helper functions
Browse files Browse the repository at this point in the history
(cherry picked from commit be07ed5)
  • Loading branch information
linuxmaniac committed Aug 1, 2020
1 parent 3a44d39 commit b5d848e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/modules/pua_usrloc/ul_publish.c
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit b5d848e

Please sign in to comment.