- basename = get_debug_link_info (objfile, &crc32);
-@@ -1385,7 +1927,7 @@ find_separate_debug_file (struct objfile
- if (basename == NULL)
- /* There's no separate debug info, hence there's no way we could
- load it => no warning. */
-- return NULL;
-+ goto cleanup_return_debugfile;
-
- dir = xstrdup (objfile->name);
-
-@@ -1407,24 +1949,19 @@ find_separate_debug_file (struct objfile
- if (canon_name && strlen (canon_name) > i)
- i = strlen (canon_name);
-
-- debugfile = alloca (strlen (debug_file_directory) + 1
-- + i
-- + strlen (DEBUG_SUBDIRECTORY)
-- + strlen ("/")
-- + strlen (basename)
-- + 1);
-+ debugfile = xmalloc (strlen (debug_file_directory) + 1
-+ + i
-+ + strlen (DEBUG_SUBDIRECTORY)
-+ + strlen ("/")
-+ + strlen (basename)
-+ + 1);
-
- /* First try in the same directory as the original file. */
- strcpy (debugfile, dir);
- strcat (debugfile, basename);
-
- if (separate_debug_file_exists (debugfile, crc32, objfile->name))
-- {
-- xfree (basename);
-- xfree (dir);
-- xfree (canon_name);
-- return xstrdup (debugfile);
-- }
-+ goto cleanup_return_debugfile;
-
- /* Then try in the subdirectory named DEBUG_SUBDIRECTORY. */
- strcpy (debugfile, dir);
-@@ -1433,12 +1970,7 @@ find_separate_debug_file (struct objfile
- strcat (debugfile, basename);
-
- if (separate_debug_file_exists (debugfile, crc32, objfile->name))
-- {
-- xfree (basename);
-- xfree (dir);
-- xfree (canon_name);
-- return xstrdup (debugfile);
-- }
-+ goto cleanup_return_debugfile;
-
- /* Then try in the global debugfile directory. */
- strcpy (debugfile, debug_file_directory);
-@@ -1447,12 +1979,7 @@ find_separate_debug_file (struct objfile
- strcat (debugfile, basename);
-
- if (separate_debug_file_exists (debugfile, crc32, objfile->name))
-- {
-- xfree (basename);
-- xfree (dir);
-- xfree (canon_name);
-- return xstrdup (debugfile);
-- }
-+ goto cleanup_return_debugfile;
-
- /* If the file is in the sysroot, try using its base path in the
- global debugfile directory. */
-@@ -1466,20 +1993,18 @@ find_separate_debug_file (struct objfile
- strcat (debugfile, basename);