Fix internal warning when "gdb -p xxx"
[deliverable/binutils-gdb.git] / gdb / darwin-nat.c
index 88cecf3acc693f52ec6746df4a2a22a9e93d32e8..23a921d80eed845e96f6f8877587021e8311fdcf 100644 (file)
@@ -1991,12 +1991,9 @@ set_enable_mach_exceptions (char *args, int from_tty,
 static char *
 darwin_pid_to_exec_file (struct target_ops *self, int pid)
 {
-  char *path;
+  static char path[PATH_MAX];
   int res;
 
-  path = xmalloc (PATH_MAX);
-  make_cleanup (xfree, path);
-
   res = proc_pidinfo (pid, PROC_PIDPATHINFO, 0, path, PATH_MAX);
   if (res >= 0)
     return path;
This page took 0.02513 seconds and 4 git commands to generate.