mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
common: Smart up register_mem_cleanup_func.
* common/init.c (register_mem_cleanup_func): Avoid double registration. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
49fdd0887c
commit
6446a6b3df
@ -106,6 +106,10 @@ register_mem_cleanup_func (void (*func)(void))
|
||||
{
|
||||
mem_cleanup_item_t item;
|
||||
|
||||
for (item = mem_cleanup_list; item; item = item->next)
|
||||
if (item->func == func)
|
||||
return; /* Function has already been registered. */
|
||||
|
||||
item = malloc (sizeof *item);
|
||||
if (item)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user