mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-08 21:18:51 +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)
|
if (dlen > len)
|
||||||
{
|
{
|
||||||
|
closedir (dir);
|
||||||
xfree (basename);
|
xfree (basename);
|
||||||
xfree (dirname);
|
xfree (dirname);
|
||||||
return -1;
|
return -1;
|
||||||
@ -734,6 +735,7 @@ dotlock_detect_tname (dotlock_t h)
|
|||||||
tname_path = strchr (h->tname + strlen (dirname) + 2, '.');
|
tname_path = strchr (h->tname + strlen (dirname) + 2, '.');
|
||||||
if (!tname_path)
|
if (!tname_path)
|
||||||
{
|
{
|
||||||
|
closedir (dir);
|
||||||
xfree (basename);
|
xfree (basename);
|
||||||
xfree (dirname);
|
xfree (dirname);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user