aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli/cli-dump.c')
-rw-r--r--gdb/cli/cli-dump.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index ee3ce03..1df2662 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -135,6 +135,9 @@ dump_binary_file (const char *filename, const char *mode,
int status;
gdb_file_up file = gdb_fopen_cloexec (filename, mode);
+ if (file == nullptr)
+ perror_with_name (filename);
+
status = fwrite (buf, len, 1, file.get ());
if (status != 1)
perror_with_name (filename);