summaryrefslogtreecommitdiff
path: root/bfd/format.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-20 10:03:30 +1030
committerAlan Modra <amodra@gmail.com>2019-12-20 13:36:06 +1030
commit9d78076ef8ef07890ad89c1122bdf49932a979a5 (patch)
tree24cd4c623db252ec7b2d63d3a36eb0faf67dfbc5 /bfd/format.c
parentfcc5d04f9264b75241fc50cf655a49c9a7de7d76 (diff)
downloadbinutils-gdb-9d78076ef8ef07890ad89c1122bdf49932a979a5.tar.gz
bfd_check_format memory leak
* format.c (bfd_check_format_matches): Free matching_vector when not returning matching target strings.
Diffstat (limited to 'bfd/format.c')
-rw-r--r--bfd/format.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/format.c b/bfd/format.c
index 1d1363d1840..17b48556a9a 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;
}