src/pomp_prot.c
int pomp_prot_release_msg(struct pomp_prot *prot, struct pomp_msg *msg)
{
	POMP_RETURN_ERR_IF_FAILED(prot != NULL, -EINVAL);
	POMP_RETURN_ERR_IF_FAILED(msg != NULL, -EINVAL);

	/* if we already have one, destroy given one, otherwise get ownership
	 * but clear it */
	if (prot->msg != NULL) {
		pomp_msg_destroy(msg);
	} else {
		prot->msg = msg;
		pomp_msg_clear(prot->msg);
	}
	return 0;
}
/**
 * Release a previously decoded message. This is to reuse message structure
 * if possible and avoid some malloc/free at each decoded message. If there
 * is already a internal message structure, it is simply destroyed.
 * @param prot : protocol decoder.
 * @param msg : message to release.
 * @return 0 in case of success, negative errno value in case of error.
 */
Release a previously decoded message. This is to reuse message structure
if possible and avoid some malloc/free at each decoded message. If there
is already a internal message structure, it is simply destroyed.
@param prot : protocol decoder.
@param msg : message to release.
@return 0 in case of success, negative errno value in case of error.
Release a previously decoded message . This is to reuse message structure if possible and avoid some malloc / free at each decoded message . If there is already a internal message structure it is simply destroyed . @param prot : protocol decoder . @param msg : message to release . @return 0 in case of success negative errno value in case of error .
int pomp_prot_release_msg(struct pomp_prot *prot, struct pomp_msg *msg)
{
	POMP_RETURN_ERR_IF_FAILED(prot != NULL, -EINVAL);
	POMP_RETURN_ERR_IF_FAILED(msg != NULL, -EINVAL);
	if (prot->msg != NULL) {
		pomp_msg_destroy(msg);
	} else {
		prot->msg = msg;
		pomp_msg_clear(prot->msg);
	}
	return 0;
}
int pomp_prot_release_msg ( struct pomp_prot * prot , struct pomp_msg * msg ) { POMP_RETURN_ERR_IF_FAILED ( prot != NULL , - EINVAL ) ; POMP_RETURN_ERR_IF_FAILED ( msg != NULL , - EINVAL ) ; if ( prot -> msg != NULL ) { pomp_msg_destroy ( msg ) ; } else { prot -> msg = msg ; pomp_msg_clear ( prot -> msg ) ; } return 0 ; }
Release a previously decoded message.
Release a previously decoded message .
/* if we already have one, destroy given one, otherwise get ownership
	 * but clear it */