mirror of
https://github.com/openssh/openssh-portable.git
synced 2026-11-06 05:16:43 +00:00
upstream: Fix memory leak on an error path in mkdir_path
CID 913589 OK djm@ OpenBSD-Commit-ID: 0050b75ec87722e115d33a3d181a3c24175079e5
This commit is contained in:
1 parent
805388d59d
commit
961cc92164
1 file changed
+2
-1
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: misc.c,v 1.216 2026/09/07 20:24:22 job Exp $ */
|
||||
/* $OpenBSD: misc.c,v 1.217 2026/09/15 08:26:49 job Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2000 Markus Friedl. All rights reserved.
|
||||
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
|
||||
@@ -3239,6 +3239,7 @@ mkdir_path(const char *target, mode_t mode)
|
||||
if (*dir == '/' &&
|
||||
(fd = open("/", O_RDONLY|O_DIRECTORY)) == -1) {
|
||||
error_f("open(\"/\"): %s", strerror(errno));
|
||||
free(odir);
|
||||
return -1;
|
||||
}
|
||||
/* Work through the path, component-wise */
|
||||
|
||||
Reference in new issue
Block a user