mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-21 10:09:57 +01:00
dotlock: Avoid leaking directory handle.
* common/dotlock.c (dotlock_detect_tname): Close directory on errors. -- GnuPG-bug-id: 7201 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
parent
f66e9356f8
commit
4bdd43fdca
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user