[PATCH 3/4] tools/cpu/nios2/ptf.c: Fix leak of memory pointed to by new_prefix

Gedare Bloom gedare at rtems.org
Wed Sep 2 13:40:33 UTC 2015


Martin's patch also checks for null new_prefix earlier.

On Tue, Sep 1, 2015 at 5:40 PM, Joel Sherrill <joel.sherrill at oarcorp.com> wrote:
> Updates #2405.
> ---
>  tools/cpu/nios2/ptf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/cpu/nios2/ptf.c b/tools/cpu/nios2/ptf.c
> index 7a31c11..2b9448c 100644
> --- a/tools/cpu/nios2/ptf.c
> +++ b/tools/cpu/nios2/ptf.c
> @@ -578,6 +578,7 @@ void ptf_printf(FILE *s, struct ptf *tree, char *prefix)
>          fputs(new_prefix, s);
>          fputs("\n", s);
>          ptf_printf(s, leaf->sub, new_prefix);
> +       free(new_prefix);
>          break;
>        };
>
> --
> 1.8.3.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list