aboutsummaryrefslogtreecommitdiff
path: root/gdb/debuginfod-support.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/debuginfod-support.c')
-rw-r--r--gdb/debuginfod-support.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index a7c76ab..e21b2f4 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -134,7 +134,8 @@ debuginfod_source_query (const unsigned char *build_id,
printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"),
safe_strerror (-fd.get ()),
styled_string (file_name_style.style (), srcpath));
- else
+
+ if (fd.get () >= 0)
*destname = make_unique_xstrdup (srcpath);
return fd;
@@ -169,7 +170,8 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
safe_strerror (-fd.get ()),
styled_string (file_name_style.style (), filename));
- destname->reset (dname);
+ if (fd.get () >= 0)
+ destname->reset (dname);
return fd;
}