Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613)
[deliverable/binutils-gdb.git] / gdb / bsd-kvm.c
index 21f978728da629ef3569f996af9cfe7aa12fe8f6..895686ef628a72b2d1599308da018ea991617634 100644 (file)
@@ -114,14 +114,13 @@ bsd_kvm_target_open (const char *arg, int from_tty)
 
   if (arg)
     {
-      char *temp;
-
       filename = tilde_expand (arg);
       if (filename[0] != '/')
        {
-         temp = concat (current_directory, "/", filename, (char *)NULL);
+         gdb::unique_xmalloc_ptr<char> temp (gdb_abspath (filename));
+
          xfree (filename);
-         filename = temp;
+         filename = temp.release ();
        }
     }
 
This page took 0.024272 seconds and 4 git commands to generate.