From: Paul Eggert Date: Sat, 21 Mar 2020 23:13:28 +0000 (-0700) Subject: unlink: fix malloc errno typo X-Git-Tag: v1.0~4188 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3e89c500a2f17a8a7a278390d48419990ce24bc8;p=gnulib.git unlink: fix malloc errno typo Problem reported by Tim Rühsen in: https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html * lib/unlink.c (rpl_unlink): Don’t mask malloc errno. --- diff --git a/ChangeLog b/ChangeLog index 0019334ca9..9b2a112eb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-03-21 Paul Eggert + + unlink: fix malloc errno typo + Problem reported by Tim Rühsen in: + https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html + * lib/unlink.c (rpl_unlink): Don’t mask malloc errno. + 2020-03-16 Bruno Haible *printf-posix: Fix m4 error (regression from 2020-03-08). diff --git a/lib/unlink.c b/lib/unlink.c index b7daa7cd36..5e0f4e177d 100644 --- a/lib/unlink.c +++ b/lib/unlink.c @@ -65,10 +65,7 @@ rpl_unlink (char const *name) /* Trailing NUL will overwrite the trailing slash. */ char *short_name = malloc (len); if (!short_name) - { - errno = EPERM; - return -1; - } + return -1; memcpy (short_name, name, len); while (len && ISSLASH (short_name[len - 1])) short_name[--len] = '\0';