[PATCH 1/2] ubox: fix GCC fanalyzer warnings

Rosen Penev rosenp at gmail.com
Mon Jul 18 15:14:19 PDT 2022


On Mon, Jul 18, 2022 at 1:45 AM Jo-Philipp Wich <jo at mein.io> wrote:
>
> Hi,
>
> > [...]
> > -     free(aliases);
> > +     if (aliases)
> > +         free(aliases);
>
> This check is redundant, the free() function is guaranteed to be NULL-safe in
> the standard:
>
>    The free() function shall cause the space pointed to by ptr to be
>    deallocated; that is, made available for further allocation. If ptr is a
>    null pointer, no action shall occur.
It seems the error was fixed in some other way. Removed.
>
> > [...]
>
> ~ Jo
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list