[PATCH:xdm 1/5] Fix potential memory leak in allocation failure cleanup path
Error: Memory leak (CWE 401) Memory leak of pointer 'newargv' allocated with realloc(((i8*)argv), ((i * 4) + 8)) at line 239 of /export/alanc/X.Org/git/app/xdm/xdm/util.c in function 'parseArgs'. 'newargv' allocated at line 231 with realloc(((i8*)argv), ((i * 4) + 8)). newargv leaks when newargv != 0 at line 234 and save == 0 at line 234. [This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith --- xdm/util.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/xdm/util.c b/xdm/util.c index 65b3b85..572b9c5 100644 --- a/xdm/util.c +++ b/xdm/util.c @@ -234,6 +234,7 @@ parseArgs (char **argv, char *string) if (!newargv || !save) { LogOutOfMem ("parseArgs"); free ((char *) argv); + free (newargv); if (save) free (save); return NULL; -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 1/5] Fix potential memory leak in allocation failure cleanup path
Twas brillig at 11:01:29 14.05.2011 UTC-07 when alan.coopersm...@oracle.com did gyre and gimble: AC> Signed-off-by: Alan Coopersmith Reviewed-by: Mikhail Gusarov for the series. -- http://fossarchy.blogspot.com/ pgp8Z3uXrP46I.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 1/5] Fix potential memory leak in allocation failure cleanup path
On Sat, May 14, 2011 at 11:01:29 -0700, Alan Coopersmith wrote: > Error: Memory leak (CWE 401) >Memory leak of pointer 'newargv' allocated with realloc(((i8*)argv), ((i * > 4) + 8)) > at line 239 of /export/alanc/X.Org/git/app/xdm/xdm/util.c in function > 'parseArgs'. > 'newargv' allocated at line 231 with realloc(((i8*)argv), ((i * 4) > + 8)). > newargv leaks when newargv != 0 at line 234 > and save == 0 at line 234. > > [This bug was found by the Parfait 0.3.7 bug checking tool. > For more information see http://labs.oracle.com/projects/parfait/ ] > > Signed-off-by: Alan Coopersmith > --- > xdm/util.c |1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > For the series, Reviewed-by: Julien Cristau Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel