krb5: Fix FD leak in ENOMEM in stdio_from_fd
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user