@@ -229,6 +229,9 @@ void update_htable(ua_pres_t* p, time_t desired_expires, int expires,
if(p->remote_contact.s== NULL)
{
SHM_MEM_ERROR;
+ if(etag) {
+ shm_free(p->etag.s);
+ }
return;
}
memcpy(p->remote_contact.s, contact->s, contact->len);
@@ -601,6 +601,9 @@ static int db_restore(void)
if(p->etag.s== NULL)
+ if(watcher_uri.s && watcher_uri.len) {
+ shm_free(p->remote_contact.s);
goto error;
memcpy(p->etag.s, etag.s, etag.len);
@@ -409,6 +409,7 @@ void publ_cback_func(struct cell *t, int type, struct tmcb_params *ps)
if(presentity->etag.s== NULL)
+ shm_free(presentity);
memcpy(presentity->etag.s, etag.s, etag.len);
@@ -654,7 +654,9 @@ faked_error:
presentity->remote_contact.s= (char*)shm_malloc(contact.len* sizeof(char));
if(presentity->remote_contact.s==NULL)
- ERR_MEM(SHARE_MEM);
+ SHM_MEM_ERROR;
+ return;
memcpy(presentity->remote_contact.s, contact.s, contact.len);
presentity->remote_contact.len= contact.len;