add: if ((*_c)->instance.s) shm_free((*_c)->instance.s);
context: int new_ucontact(str* _dom, str* _aor, str* _contact, time_t _e, qvalue_t _q,		 str* _callid, int _cseq, unsigned int _flags, 		 ucontact_t** _c, str* _ua, str* _recv, struct socket_info* sock,		 str* _inst){	*_c = (ucontact_t*)shm_malloc(sizeof(ucontact_t));	if (!(*_c)) {	        LOG(L_ERR, "new_ucontact(): No memory left\n");		return -1;	}	memset(*_c, 0, sizeof(ucontact_t));	(*_c)->domain = _dom;	(*_c)->aor = _aor;	(*_c)->c.s = (char*)shm_malloc(_contact->len);	if ((*_c)->c.s == 0) {		LOG(L_ERR, "new_ucontact(): No memory left 2\n");		goto error;	}	memcpy((*_c)->c.s, _contact->s, _contact->len);	(*_c)->c.len = _contact->len;	(*_c)->expires = _e;	(*_c)->q = _q;	(*_c)->callid.s = (char*)shm_malloc(_callid->len);	if ((*_c)->callid.s == 0) {		LOG(L_ERR, "new_ucontact(): No memory left 4\n");		goto error;	}	memcpy((*_c)->callid.s, _callid->s, _callid->len);	(*_c)->callid.len = _callid->len;	(*_c)->user_agent.s = (char*)shm_malloc(_ua->len);	if ((*_c)->user_agent.s == 0) {		LOG(L_ERR, "new_ucontact(): No memory left 8\n");		goto error;	}	memcpy((*_c)->user_agent.s, _ua->s, _ua->len);	(*_c)->user_agent.len = _ua->len;	if (_recv) {		(*_c)->received.s = (char*)shm_malloc(_recv->len);		if ((*_c)->received.s == 0) {			LOG(L_ERR, "new_ucontact(): No memory left\n");			goto error;		}		memcpy((*_c)->received.s, _recv->s, _recv->len);		(*_c)->received.len = _recv->len;	} else {		(*_c)->received.s = 0;		(*_c)->received.len = 0;	}	if(_inst) {		(*_c)->instance.s = (char*)shm_malloc(_inst->len);		if ((*_c)->instance.s == 0) {			LOG(L_ERR, "new_ucontact(): No memory left\n");			goto error;		}		memcpy((*_c)->instance.s, _inst->s, _inst->len);		(*_c)->instance.len = _inst->len;	} else {		(*_c)->instance.s = 0;		(*_c)->instance.len = 0;	}		(*_c)->cseq = _cseq;	(*_c)->state = CS_NEW;	(*_c)->flags = _flags;	(*_c)->sock = sock;	return 0;error:	if (*_c) {		if ((*_c)->instance.s) shm_free((*_c)->instance.s);		if ((*_c)->received.s) shm_free((*_c)->received.s); 		if ((*_c)->user_agent.s) shm_free((*_c)->user_agent.s); 		if ((*_c)->callid.s) shm_free((*_c)->callid.s); 		if ((*_c)->c.s) shm_free((*_c)->c.s); 		shm_free(*_c);	}	return -1;	}	