This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 29/40] fix in solib-aix.c
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:52:06 -0600
- Subject: [PATCH 29/40] fix in solib-aix.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
solib_aix_bfd_open has an early "return" that doesn't run cleanups.
This fixes the problem by dropping the null_cleanup and using a later
cleanup as the master cleanup for the function.
* solib-aix.c (solib_aix_bfd_open): Don't use a null cleanup
for 'cleanup'; instead use a later one.
---
gdb/solib-aix.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index 9fa5de9..95b1ce1 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -643,7 +643,7 @@ solib_aix_bfd_open (char *pathname)
int filename_len;
char *member_name;
bfd *archive_bfd, *object_bfd;
- struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
+ struct cleanup *cleanup;
if (pathname[path_len - 1] != ')')
return solib_bfd_open (pathname);
@@ -661,7 +661,7 @@ solib_aix_bfd_open (char *pathname)
filename_len = sep - pathname;
filename = xstrprintf ("%.*s", filename_len, pathname);
- make_cleanup (xfree, filename);
+ cleanup = make_cleanup (xfree, filename);
member_name = xstrprintf ("%.*s", path_len - filename_len - 2, sep + 1);
make_cleanup (xfree, member_name);
--
1.8.1.4