summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:31:48 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:31:48 +0000
commit60adeb1b551428ac5ae33365c80981db3c676cce (patch)
tree053beeaa66cdc130916158ea9522ce1b61031b54 /gdb
parent0abc7a2bdbfb6c3e08c7d89dae7a50297c18ccd0 (diff)
downloadgdb-60adeb1b551428ac5ae33365c80981db3c676cce.tar.gz
fix linux-thread-db.c
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/linux-thread-db.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 89298e88b37..c2eb3bb8bdb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-05-30 Tom Tromey <tromey@redhat.com>
+ * linux-thread-db.c (thread_db_load_search): Unconditionally
+ call do_cleanups.
+
+2013-05-30 Tom Tromey <tromey@redhat.com>
+
* solib-aix.c (solib_aix_bfd_open): Don't use a null cleanup
for 'cleanup'; instead use a later one.
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index a698c659fc9..23c29c9dd1d 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;
}