* [PATCH] readelf: Clean up section lists after usage.
@ 2019-05-09 17:25 Mark Wielaard
2019-05-14 18:51 ` Mark Wielaard
0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2019-05-09 17:25 UTC (permalink / raw)
To: elfutils-devel; +Cc: Mark Wielaard
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/ChangeLog | 5 +++++
src/readelf.c | 14 ++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/src/ChangeLog b/src/ChangeLog
index ae13793..0c817f4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-09 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (cleanup_list): New function.
+ (main): Call cleanup_list for dump_data_sections and string_sections.
+
2019-04-28 Mark Wielaard <mark@klomp.org>
* unstrip.c (add_new_section_symbols): Call ELF_CHECK after
diff --git a/src/readelf.c b/src/readelf.c
index c346e1f..4c20c38 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -312,6 +312,17 @@ static void dump_archive_index (Elf *, const char *);
static char *yes_str;
static char *no_str;
+static void
+cleanup_list (struct section_argument *list)
+{
+ while (list != NULL)
+ {
+ struct section_argument *a = list;
+ list = a->next;
+ free (a);
+ }
+}
+
int
main (int argc, char *argv[])
{
@@ -353,6 +364,9 @@ main (int argc, char *argv[])
}
while (++remaining < argc);
+ cleanup_list (dump_data_sections);
+ cleanup_list (string_sections);
+
return error_message_count != 0;
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] readelf: Clean up section lists after usage.
2019-05-09 17:25 [PATCH] readelf: Clean up section lists after usage Mark Wielaard
@ 2019-05-14 18:51 ` Mark Wielaard
0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2019-05-14 18:51 UTC (permalink / raw)
To: elfutils-devel
On Thu, May 09, 2019 at 04:55:23PM +0200, Mark Wielaard wrote:
> +2019-05-09 Mark Wielaard <mark@klomp.org>
> +
> + * readelf.c (cleanup_list): New function.
> + (main): Call cleanup_list for dump_data_sections and string_sections.
Pushed to master.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-14 18:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 17:25 [PATCH] readelf: Clean up section lists after usage Mark Wielaard
2019-05-14 18:51 ` Mark Wielaard
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).