gpg: Fix memory leak in parse_auto_key_locate.

* g10/getkey.c (parse_auto_key_locate): Fix freeing of OPTIONS.
--

It was probably too late for me to hack.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-08-04 22:46:40 +02:00
parent 0767eada14
commit b70e86fd10
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 4 additions and 3 deletions

View File

@ -4232,8 +4232,9 @@ int
parse_auto_key_locate (const char *options_arg)
{
char *tok;
char *options = xstrdup (options_arg);
char *options, *options_buf;
options = options_buf = xstrdup (options_arg);
while ((tok = optsep (&options)))
{
struct akl *akl, *check, *last = NULL;
@ -4272,7 +4273,7 @@ parse_auto_key_locate (const char *options_arg)
else
{
free_akl (akl);
xfree (options);
xfree (options_buf);
return 0;
}
@ -4301,7 +4302,7 @@ parse_auto_key_locate (const char *options_arg)
}
}
xfree (options);
xfree (options_buf);
return 1;
}