fix linux-thread-db.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:31:48 +0000 (17:31 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:31:48 +0000 (17:31 +0000)
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/ChangeLog
gdb/linux-thread-db.c

index 89298e88b3716c679d0da1778034724d2b7518dc..c2eb3bb8bdbe4a4cd2d227a9433b74168fa28c56 100644 (file)
@@ -1,3 +1,8 @@
+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
index a698c659fc93387deb816c6ba54f96590785b363..23c29c9dd1d2d274f26fe4f0828f4358fe055210 100644 (file)
@@ -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;
        }