krb5: Fix FD leak in ENOMEM in stdio_from_fd

This commit is contained in:
Nicolas Williams
2020-09-15 11:26:52 -05:00
parent b2b6599f87
commit 3c7d12e116

View File

@@ -215,8 +215,10 @@ krb5_storage_stdio_from_fd(int fd_in, const char *mode)
return NULL; return NULL;
f = fdopen(fd, mode); f = fdopen(fd, mode);
if (f == NULL) if (f == NULL) {
(void) close(fd);
return NULL; return NULL;
}
errno = saved_errno; errno = saved_errno;