[PATCH] malloc: fix memleak in function muntrace

Florian Weimer fw@deneb.enyo.de
Sun Apr 19 11:39:42 GMT 2020


* chenzefeng:

> diff --git a/malloc/mtrace.c b/malloc/mtrace.c
> index 7e7719df97..0b92106e6e 100644
> --- a/malloc/mtrace.c
> +++ b/malloc/mtrace.c
> @@ -365,4 +365,6 @@ muntrace (void)
>  
>    fprintf (f, "= End\n");
>    fclose (f);
> +  if (mtb != NULL)
> +    free (mtb);
>  }

I don't think this will build.  The global variable is called
malloc_trace_buffer.


More information about the Libc-alpha mailing list