public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gas: Free unused memory in scfi_ops_cleanup
@ 2024-04-09 23:04 H.J. Lu
  2024-04-11  5:40 ` Indu Bhagat
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2024-04-09 23:04 UTC (permalink / raw)
  To: binutils; +Cc: indu.bhagat

	* scfi.c (scfi_ops_cleanup): Free op->op_data and head.
---
 gas/scfi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gas/scfi.c b/gas/scfi.c
index f34150cb08a..24170c7f8ee 100644
--- a/gas/scfi.c
+++ b/gas/scfi.c
@@ -141,10 +141,13 @@ scfi_ops_cleanup (scfi_opS **head)
 
   while (op)
     {
+      free (op->op_data);
       free (op);
       op = next;
       next = op ? op->next : NULL;
     }
+
+  free (head);
 }
 
 /* Compare two SCFI states.  */
-- 
2.44.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gas: Free unused memory in scfi_ops_cleanup
  2024-04-09 23:04 [PATCH] gas: Free unused memory in scfi_ops_cleanup H.J. Lu
@ 2024-04-11  5:40 ` Indu Bhagat
  0 siblings, 0 replies; 2+ messages in thread
From: Indu Bhagat @ 2024-04-11  5:40 UTC (permalink / raw)
  To: H.J. Lu, binutils

On 4/9/24 16:04, H.J. Lu wrote:
> 	* scfi.c (scfi_ops_cleanup): Free op->op_data and head.

Thanks for the patch.

> ---
>   gas/scfi.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/gas/scfi.c b/gas/scfi.c
> index f34150cb08a..24170c7f8ee 100644
> --- a/gas/scfi.c
> +++ b/gas/scfi.c
> @@ -141,10 +141,13 @@ scfi_ops_cleanup (scfi_opS **head)
>   
>     while (op)
>       {
> +      free (op->op_data);
>         free (op);
>         op = next;
>         next = op ? op->next : NULL;
>       }
> +
> +  free (head);
>   }
>   
>   /* Compare two SCFI states.  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-11  5:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-09 23:04 [PATCH] gas: Free unused memory in scfi_ops_cleanup H.J. Lu
2024-04-11  5:40 ` Indu Bhagat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).