Re: [PATCH] newlib: libc: Fix memory leak in computematchjumps()

Kuan-Wei Chiu <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <ZWqu5VpxlegrOeQl@visitorckw-System-Product-Name>
On Fri, Dec 01, 2023 at 03:08:30PM -0500, Mike Frysinger wrote:
> On 02 Dec 2023 00:13, Kuan-Wei Chiu wrote:
> > --- a/newlib/libc/posix/regcomp.c
> > +++ b/newlib/libc/posix/regcomp.c
> > @@ -2001,8 +2001,10 @@ struct re_guts *g;
> >  	}
> >  
> >  	g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int));
> > -	if (g->matchjump == NULL)	/* Not a fatal error */
> > -		return;
> > +	if (g->matchjump == NULL) { /* Not a fatal error */
> > +        free(pmatches);
> > +        return;
> > +    }
> 
> the code uses tabs for indentation, but you used spaces for some reason
> -mike

Hi Mike,

Thank you for reviewing the patch. I apologize for the oversight
regarding the indentation inconsistency—using spaces instead of tabs.

I will submit another patch that corrects the indentation.

Best regards,
Kuan-Wei Chiu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.