[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/.

Alexander Huemer alexander.huemer at xx.vu
Tue Oct 11 21:54:13 UTC 2011


On Tue, Oct 11, 2011 at 11:07:35PM +0200, Holger Hans Peter Freyther wrote:
> 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
> 
You are right. I'll resend the patch.




More information about the OpenBSC mailing list