public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: binutils@sourceware.org
Cc: indu.bhagat@oracle.com
Subject: [PATCH] gas: Free unused memory in scfi_ops_cleanup
Date: Tue,  9 Apr 2024 16:04:49 -0700	[thread overview]
Message-ID: <20240409230449.2466499-1-hjl.tools@gmail.com> (raw)

	* 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


             reply	other threads:[~2024-04-09 23:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 23:04 H.J. Lu [this message]
2024-04-11  5:40 ` Indu Bhagat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240409230449.2466499-1-hjl.tools@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=indu.bhagat@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).