Home GnuPG
Diffusion GnuPG 2af7bb2295cd

g10: Fix memory leaks

Description

g10: Fix memory leaks

* g10/card-util.c (change_pin): free answer on errors
  (ask_card_keyattr): free answer on error
* g10/cpr.c (do_get_from_fd): free string
* g10/gpg.c (check_permissions): free dir on weird error
* g10/import.c (append_new_uid): release knode
* g10/keyedit.c (menu_set_keyserver_url): free answer
  (menu_set_keyserver_url): free user
* g10/keygen.c (print_status_key_not_created): move allocation after
  sanity check
  (ask_expire_interval): free answer
  (card_store_key_with_backup): goto leave instaed of return
* g10/keyserver.c (parse_keyserver_uri): goto fail instead of return
* g10/revoke.c (gen_desig_revoke): release kdbhd
  (gen_desig_revoke): free answer
* g10/tofu.c (ask_about_binding): free sqerr and response
* g10/trustdb.c (ask_ownertrust): free pk

Further changes:

  • g10/card-util.c (change_pin): Do not set answer to NULL.
  • g10/keyedit.c(menu_set_keyserver_url): Use !func() pattern.
  • Signed-off-by: Werner Koch <wk@gnupg.org>
  • GnuPG-bug-id: T5393

Details

Provenance
JakujeAuthored on May 20 2021, 10:13 AM
wernerCommitted on May 20 2021, 1:38 PM
Parents
rG0d2c1e9046fa: dirmgr: clean up memory on error code paths
Branches
Unknown
Tags
Unknown
Tasks
T5393: gnupg coverity static analysis reports