gpg: Fix attempt to double free an UID structure.
authorWerner Koch <wk@gnupg.org>
Sun, 5 Mar 2017 22:24:15 +0000 (23:24 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 6 Mar 2017 06:57:08 +0000 (07:57 +0100)
commit4a130bbc2c2f4be6e8c6357512a943f435ade28f
treeab4c658a06b00b37c386ba7303b155bd55248bef
parente6ca015ae182a6dbb0466441efc17c99683e9375
gpg: Fix attempt to double free an UID structure.

* g10/getkey.c (get_best_pubkey_byname): Set released .UID to NULL.
--

Phil Pennock reported an assertion failure when doing

  % gpg --auto-key-locate dane --locate-keys someone
  gpg: Ohhhh jeeee: Assertion "uid->ref > 0" in \
         free_user_id failed (free-packet.c:310)

on his keyring.  This patch is not tested but a good guess.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/getkey.c