fix cp-namespace.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:29:06 +0000 (17:29 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:29:06 +0000 (17:29 +0000)
cp_lookup_symbol_imports_or_template could return without
running cleanups.

* cp-namespace.c (cp_lookup_symbol_imports_or_template): Call
do_cleanups on all return paths.

gdb/ChangeLog
gdb/cp-namespace.c

index 30b2bb0251e77a3b66393b4bcc5896d89c7d3d52..55df48c30d0417eabdd7fe4061dd0c825bf20b31 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-30  Tom Tromey  <tromey@redhat.com>
+
+       * cp-namespace.c (cp_lookup_symbol_imports_or_template): Call
+       do_cleanups on all return paths.
+
 2013-05-30  Tom Tromey  <tromey@redhat.com>
 
        * top.c (execute_command): Discard 'cleanup_if_error' cleanups.
index add4ccb913a47637f4617a1324c58e364bcdb825..792ed48f34493e1f99147044ea15b8c1fd702372 100644 (file)
@@ -499,7 +499,10 @@ cp_lookup_symbol_imports_or_template (const char *scope,
                                      TYPE_N_TEMPLATE_ARGUMENTS (context),
                                      TYPE_TEMPLATE_ARGUMENTS (context));
              if (result != NULL)
-               return result;
+               {
+                 do_cleanups (cleanups);
+                 return result;
+               }
            }
 
          do_cleanups (cleanups);