[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Trivial change: Remove superfluous guarding of errno around free



Hi,

I'm not subscribed; please CC me.

It appears you don't accept Salsa merge requests or anonymous pushes, so
I'd like to inform you of a trivial change which can be merged from my
master branch on https://salsa.debian.org/jscott/dpkg.git
Alternatively, the patch follows:

No system is known to set errno when using free, successfully or
otherwise, and POSIX Issue 8 is slated to protect it on success
to simplify error handling:
https://www.austingroupbugs.net/view.php?id=385
---
 utils/update-alternatives.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 89264d374..876472d47 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -378,10 +378,7 @@ areadlink(const char *linkname)
 	/* Read it and terminate the string properly */
 	size = readlink(linkname, buf, st.st_size);
 	if (size == -1) {
-		int saved_errno = errno;
-
 		free(buf);
-		errno = saved_errno;
 
 		return NULL;
 	}
-- 
2.29.2

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: