diff options
author | Werner Koch <[email protected]> | 2017-08-04 20:46:40 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-08-04 20:46:40 +0000 |
commit | b70e86fd1050fc6da07a177ed142ae9882b4dd0d (patch) | |
tree | 38dcb0e92826879b61a1b30a9f2d9b72f458f7e8 /g10/getkey.c | |
parent | tests: Adjust tests for changed --auto-key-locate default. (diff) | |
download | gnupg-b70e86fd1050fc6da07a177ed142ae9882b4dd0d.tar.gz gnupg-b70e86fd1050fc6da07a177ed142ae9882b4dd0d.zip |
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 <[email protected]>
Diffstat (limited to 'g10/getkey.c')
-rw-r--r-- | g10/getkey.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index 5b7aff941..852c53286 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -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; } |