This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
bfd_check_format memory leak
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 20 Dec 2019 20:22:57 +1030
- Subject: bfd_check_format memory leak
* format.c (bfd_check_format_matches): Free matching_vector when
not returning matching target strings.
diff --git a/bfd/format.c b/bfd/format.c
index 1d1363d184..17b48556a9 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -513,6 +513,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
*(const char **) &matching_vector[match_count] = name;
}
}
+ else if (matching_vector)
+ free (matching_vector);
return FALSE;
}
--
Alan Modra
Australia Development Lab, IBM