+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
|| 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;
}