[PATCH] libbsc: fix message leaks on several error paths

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

Peter Stuge peter at stuge.se
Tue Oct 16 16:53:29 UTC 2012


Peter Stuge wrote:
> > @@ -671,9 +674,9 @@ int abis_nm_rcvmsg(struct msgb *msg)
> >  	default:
> >  		LOGP(DNM, LOGL_ERROR, "unknown ABIS OML message discriminator 0x%x\n",
> >  			oh->mdisc);
> > -		return -EINVAL;
> > +		rc = -EINVAL;
> >  	}
> 
> It looks like this is at the end of a switch () statement, so maybe
> it is a good idea to include a goto statement for clarity, even if
> that is not absolutely neccessary given how the code looks right now.

A break; would also be fine I think. Anything to make the flow explicit.


//Peter




More information about the OpenBSC mailing list