mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
common: Fix a possible resource leak for dotlock.
* common/dotlock.c (dotlock_destroy_unix): Don't release ->TNAME here. (dotlock_destroy): Release the memory unconditionally. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
8eff1d4c51
commit
5488ad0517
@ -1155,7 +1155,6 @@ dotlock_destroy_unix (dotlock_t h)
|
||||
unlink (h->lockname);
|
||||
if (h->tname && !h->use_o_excl)
|
||||
unlink (h->tname);
|
||||
xfree (h->tname);
|
||||
}
|
||||
#endif /*HAVE_POSIX_SYSTEM*/
|
||||
|
||||
@ -1208,8 +1207,12 @@ dotlock_destroy (dotlock_t h)
|
||||
#else /* !HAVE_DOSISH_SYSTEM */
|
||||
dotlock_destroy_unix (h);
|
||||
#endif /* HAVE_DOSISH_SYSTEM */
|
||||
xfree (h->lockname);
|
||||
}
|
||||
|
||||
#ifdef HAVE_POSIX_SYSTEM
|
||||
xfree (h->tname);
|
||||
#endif
|
||||
xfree (h->lockname);
|
||||
xfree(h);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user