[PATCH 1/1] libctrl: only free() msgb if it was alloc()ed

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Tue Oct 11 21:07:35 UTC 2011


On 10/11/2011 10:25 PM, Alexander Huemer wrote:

>  	struct ipaccess_head_ext *iph_ext;
> -	struct msgb *msg;
> +	struct msgb *msg = NULL;

yes

con);
> -	msgb_free(msg);
> +	if (msg)
> +		msgb_free(msg);

no, i think we should assume that msgb_free(NULL) will work.

thanks




More information about the OpenBSC mailing list