rem: free(buf->s);
add: shm_free(buf->s);
context: void dispatch_message( struct peer *p, str *buf){	struct trans *tr;	unsigned int code;	int          event;	/* reset the inactivity time */	p->last_activ_time = get_ticks();	/* get message code */	code = ((unsigned int*)buf->s)[1]&MASK_MSG_CODE;	/* check the message code */	switch ( code ) {		case CE_MSG_CODE:			event = CER_RECEIVED;			break;		case DW_MSG_CODE:			event = DWR_RECEIVED;			break;		case DP_MSG_CODE:			event = DPR_RECEIVED;			break;		default:			/* it's a session message*/			LOG(L_ERR,"UNIMPLEMENTED: message for a session arrived ->"				" discard it!!\n");			shm_free( buf->s );			return;	}	/* is request or reply? */	if (buf->s[VER_SIZE+MESSAGE_LENGTH_SIZE]&0x80) {		/* request */		tr = create_transaction( buf, 0/*ses*/, p);		if (tr) {			if (peer_state_machine( p, event, tr)==-1)				destroy_transaction( tr );		} else {			shm_free( buf->s );		}	} else {		/* response -> find its transaction and remove it from 		 * hash table (search and remove is an atomic operation) */		tr = transaction_lookup( ((unsigned int*)buf->s)[4],			((unsigned int*)buf->s)[3], 1);		if (!tr) {			LOG(L_ERR,"ERROR:dispatch_message: respons received, but no"				" transaction found!\n");			shm_free( buf->s );		} else {			/* destroy the transaction along with the originator request */			destroy_transaction( tr );			/*make from a request event a response event */			event++;			/* call the peer machine */			peer_state_machine( p, event, buf );			free(buf->s);		}	}}