This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 30/40] fix linux-thread-db.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:08 -0600
- Subject: [PATCH 30/40] fix linux-thread-db.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
This is a stylistic change to make it so the checker can analyze a
function in linux-thread-db.c.
* linux-thread-db.c (thread_db_load_search): Unconditionally
call do_cleanups.
---
gdb/linux-thread-db.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index a698c65..23c29c9 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1029,17 +1029,17 @@ thread_db_load_search (void)
|| this_dir[pdir_len] == '/'))
{
char *subdir = NULL;
- struct cleanup *free_subdir_cleanup = NULL;
+ struct cleanup *free_subdir_cleanup
+ = make_cleanup (null_cleanup, NULL);
if (this_dir[pdir_len] == '/')
{
subdir = xmalloc (strlen (this_dir));
- free_subdir_cleanup = make_cleanup (xfree, subdir);
+ make_cleanup (xfree, subdir);
strcpy (subdir, this_dir + pdir_len + 1);
}
rc = try_thread_db_load_from_pdir (subdir);
- if (free_subdir_cleanup != NULL)
- do_cleanups (free_subdir_cleanup);
+ do_cleanups (free_subdir_cleanup);
if (rc)
break;
}
--
1.8.1.4