[PATCH] Fix assert after goto failure

Mark Wielaard mark@klomp.org
Tue Mar 2 13:14:11 GMT 2021


Hi Tom,

On Mon, 2021-03-01 at 13:44 +0100, Tom de Vries wrote:
> This is because cleanup is not called.
> 
> Fix this by moving the failure label up one line.
> 
> Any comments?

This looks consistent with how the rest of the code paths calls cleanup
before returning an error.

Thanks,

Mark

> Fix assert after goto failure
> 
> 2021-03-01  Tom de Vries  <tdevries@suse.de>
> 
> 	* dwz.c (dwz): Move failure label to before cleanup.
> 
> ---
>  dwz.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dwz.c b/dwz.c
> index 8eb4f1d..d5fe7b1 100644
> --- a/dwz.c
> +++ b/dwz.c
> @@ -15434,8 +15434,8 @@ dwz (const char *file, const char *outfile,
> struct file_result *res,
>  	}
>        else if (write_aranges (dso))
>  	{
> -	  cleanup ();
>  	failure:
> +	  cleanup ();
>  	  ret = 1;
>  	}
>        else


More information about the Dwz mailing list