On 01/22/15 11:03, Luis Felipe Strano Moraes wrote:
> ---
>  toys/pending/bootchartd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/toys/pending/bootchartd.c b/toys/pending/bootchartd.c
> index 72ade69..b29d4f0 100644
> --- a/toys/pending/bootchartd.c
> +++ b/toys/pending/bootchartd.c
> @@ -294,7 +294,6 @@ void bootchartd_main()
>        putenv("PATH=/sbin:/usr/sbin:/bin:/usr/bin");
>      start_logging();
>      stop_logging(tmp_dir, bchartd_opt == 1 ? toys.optargs[1] : NULL);
> -    free(tmp_dir);
>      return;
>    } 
>    waitpid(lgr_pid, NULL, WUNTRACED);


It's worse than that, create_tmp_dir is calling dir_path() on a local
variable and then returning it from the function. It's returning a
pointer to a local variable, which gets overwritten by the next function
call.

There's a _reason_ this code is still in toys/pending. Merging it there
does _not_ mean I think it works, it's just me trying to be less of a
bottleneck when people send code submissions faster than I have a chance
to go over them in detail.

I applied the patch since it's a step in the right direction, but
there's more to do here...

Rob
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to