Replace clear_hook_in_cleanup with scoped_restore_hook_in
[deliverable/binutils-gdb.git] / gdb / xml-syscall.c
index 141ca3da922d9b2227dd27fcb2684574931c82f2..a43641893a60488a5ee47f70bd537cbbc6d2a108 100644 (file)
@@ -1,7 +1,7 @@
 /* Functions that provide the mechanism to parse a syscall XML file
    and get its values.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -363,7 +363,6 @@ static struct syscalls_info *
 xml_init_syscalls_info (const char *filename)
 {
   char *full_file;
-  char *dirname;
   struct syscalls_info *syscalls_info;
   struct cleanup *back_to;
 
@@ -373,12 +372,9 @@ xml_init_syscalls_info (const char *filename)
 
   back_to = make_cleanup (xfree, full_file);
 
-  dirname = ldirname (filename);
-  if (dirname != NULL)
-    make_cleanup (xfree, dirname);
-
   syscalls_info = syscall_parse_xml (full_file,
-                                    xml_fetch_content_from_file, dirname);
+                                    xml_fetch_content_from_file,
+                                    (void *) ldirname (filename).c_str ());
   do_cleanups (back_to);
 
   return syscalls_info;
This page took 0.023787 seconds and 4 git commands to generate.