From: Alan Modra Date: Wed, 22 Feb 2023 01:22:46 +0000 (+1030) Subject: set bfd_error on make_tempname or make_tempdir failure X-Git-Tag: binutils-2_41~1655 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e39600a691e3ba76acf6ab94edb24844c2e82b7;p=thirdparty%2Fbinutils-gdb.git set bfd_error on make_tempname or make_tempdir failure * bucomm.c (make_tempname, make_tempdir): Set bfd_error on error. --- diff --git a/binutils/bucomm.c b/binutils/bucomm.c index df60ce06547..c268fd3d913 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -555,6 +555,7 @@ make_tempname (const char *filename, int *ofd) if (fd == -1) { free (tmpname); + bfd_set_error (bfd_error_system_call); return NULL; } *ofd = fd; @@ -583,7 +584,10 @@ make_tempdir (const char *filename) #endif #endif if (ret == NULL) - free (tmpname); + { + free (tmpname); + bfd_set_error (bfd_error_system_call); + } return ret; }