mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
common: Clean up the temporary file at dotlock_destroy.
* common/dotlock.c (dotlock_destroy): Clean up the temporary file created when it fails. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
2f6fec3f48
commit
b298322d36
@ -1213,6 +1213,12 @@ dotlock_destroy (dotlock_t h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_POSIX_SYSTEM
|
#ifdef HAVE_POSIX_SYSTEM
|
||||||
|
/* When DOTLOCK_LOCK_BY_PARENT and lock fails,
|
||||||
|
the temporary file created should be removed. */
|
||||||
|
if (h->by_parent && !h->no_write && !h->locked)
|
||||||
|
if (h->tname && !h->use_o_excl)
|
||||||
|
unlink (h->tname);
|
||||||
|
|
||||||
xfree (h->tname);
|
xfree (h->tname);
|
||||||
#endif
|
#endif
|
||||||
xfree (h->lockname);
|
xfree (h->lockname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user