Home GnuPG

qt: Ensure that malloced strings are free'd

Description

qt: Ensure that malloced strings are free'd

* qt/main.cpp (qt_cmd_handler): Use unique_malloced_ptr for malloced
strings.
* qt/pinentrydialog.cpp (PinEntryDialog::generatePin,
PinEntryDialog::checkConstraints): Use unique_malloced_ptr for malloced
strings.
* qt/util.h: New.

Introducing unique_malloced_ptr<T> simplifies managing malloced strings
by free'ing them automatically, when unique_malloced_ptr is destroyed.
Fixes a memory leak in PinEntryDialog::generatePin.

Details

Provenance
ikloeckerAuthored on Aug 2 2021, 12:18 PM
Parents
rPf622321df5bb: qt: Cancel timeout on more user interactions
Branches
Unknown
Tags
Unknown
Tasks
T5517: Improvements for symmetric encryption