[PATCH v2] gas: Fix memory leaks in gen-sframe.c

Indu Bhagat indu.bhagat@oracle.com
Fri Apr 12 01:32:17 GMT 2024


On 4/11/24 04:26, H.J. Lu wrote:
> 	* gen-sframe.c (sframe_xlate_ctx_cleanup): Call XDELETE on
> 	xlate_ctx->cur_fre.
> 	(create_sframe_all): Call XDELETE on xlate_ctx after use.

Thanks for the patch.

> ---
>   gas/gen-sframe.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
> index 75781fc8ccb..25b858e432b 100644
> --- a/gas/gen-sframe.c
> +++ b/gas/gen-sframe.c
> @@ -847,6 +847,8 @@ sframe_xlate_ctx_cleanup (struct sframe_xlate_ctx *xlate_ctx)
>   	}
>       }
>   
> +  XDELETE (xlate_ctx->cur_fre);
> +
>     sframe_xlate_ctx_init (xlate_ctx);
>   }
>   
> @@ -1360,6 +1362,8 @@ create_sframe_all (void)
>   	  sframe_fde_link (sframe_fde);
>   	}
>       }
> +
> +  XDELETE (xlate_ctx);
>   }
>   
>   void



More information about the Binutils mailing list