add: error2: unlock_pdomain(d);
context: int handle_publish(struct sip_msg* _m, char* _domain, char* _s2){	struct pdomain* d;	struct presentity *p;	str p_uri;	int changed;	get_act_time();	paerrno = PA_OK;	if (parse_hfs(_m) < 0) {		LOG(L_ERR, "handle_publish(): Error while parsing message header\n");		goto error;	}	if (check_message(_m) < 0) {		LOG(L_ERR, "handle_publish(): Error while checking message\n");		goto error;	}	d = (struct pdomain*)_domain;	if (get_pres_uri(_m, &p_uri) < 0) {		LOG(L_ERR, "handle_publish(): Error while extracting presentity URI\n");		goto error;	}	lock_pdomain(d);		if (find_presentity(d, &p_uri, &p) > 0) {		changed = 1;		if (create_presentity_only(_m, d, &p_uri, &p) < 0) {			LOG(L_ERR, "handle_publish(): Error while creating new presentity\n");			unlock_pdomain(d);			goto error;		}	}	/* update presentity event state */	if (p)		publish_presentity(_m, d, p, &changed);	if (send_reply(_m) < 0) return -1;	if (p && changed) {		notify_watchers(p);	}	unlock_pdomain(d);	return 1;	 error:	send_reply(_m);	return 0;}