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

2022-07-18 Thread Rosen Penev
On Mon, Jul 18, 2022 at 1:45 AM Jo-Philipp Wich 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

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

2022-07-18 Thread Jo-Philipp Wich
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

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

2022-07-17 Thread Rosen Penev
memory leaks and missing NULL checks. Signed-off-by: Rosen Penev --- kmodloader.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/kmodloader.c b/kmodloader.c index 63bae5e..bc5f20c 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -336,6 +336,11 @@ static int sc