diff options
author | Jakub Jelen <[email protected]> | 2024-07-15 18:39:04 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2024-07-22 04:38:09 +0000 |
commit | 4bdd43fdca20c5162e0cb297f287d9235f151c43 (patch) | |
tree | 4d885fdaf807939250506bcdc8c7d6ca7ac573e7 /common | |
parent | export_secret_ssh_key: Avoid memory leak. (diff) | |
download | gnupg-4bdd43fdca20c5162e0cb297f287d9235f151c43.tar.gz gnupg-4bdd43fdca20c5162e0cb297f287d9235f151c43.zip |
dotlock: Avoid leaking directory handle.
* common/dotlock.c (dotlock_detect_tname): Close directory on errors.
--
GnuPG-bug-id: 7201
Signed-off-by: Jakub Jelen <[email protected]>
Diffstat (limited to 'common')
-rw-r--r-- | common/dotlock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/dotlock.c b/common/dotlock.c index ae77fad8a..19611ab7a 100644 --- a/common/dotlock.c +++ b/common/dotlock.c @@ -724,6 +724,7 @@ dotlock_detect_tname (dotlock_t h) if (dlen > len) { + closedir (dir); xfree (basename); xfree (dirname); return -1; @@ -734,6 +735,7 @@ dotlock_detect_tname (dotlock_t h) tname_path = strchr (h->tname + strlen (dirname) + 2, '.'); if (!tname_path) { + closedir (dir); xfree (basename); xfree (dirname); return -1; |