mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
kbx: Simplify by removing custom memory functions.
* kbx/keybox-util.c (keybox_set_malloc_hooks): Remove. (_keybox_malloc, _keybox_calloc, keybox_realloc) (_keybox_free): Remove. (keybox_file_rename): Remove. Was not used. * sm/gpgsm.c (main): Remove call to keybox_set_malloc_hooks. * kbx/kbxutil.c (main): Ditto. * kbx/keybox-defs.h: Remove all separate includes. Include util.h. remove convenience macros. * common/logging.h (return_if_fail): New. Originally from keybox-defs.h but now using log_debug. (return_null_if_fail): Ditto. (return_val_if_fail): Ditto. (never_reached): Ditto. -- Originally the KBX code was written to allow standalone use. However this required lot of ugliness like separate memory allocators and such. It also precludes the use of some standard functions from common due to their use of the common gnupg malloc functions. Dropping all that makes things easier. Minor disadvantages: the kbx call done for gpg will now use gcry malloc fucntions and not the standard malloc functions. This might be a bit slower but removing them even fixes a possible bug in keybox_tmp_names which is used in gpg and uses gpg's xfree which is actually gcry_free. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
290348e349
commit
f3ba66781a
6 changed files with 29 additions and 126 deletions
|
@ -1007,8 +1007,6 @@ main ( int argc, char **argv)
|
|||
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
|
||||
setup_libassuan_logging (&opt.debug, NULL);
|
||||
|
||||
keybox_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
||||
|
||||
/* Setup a default control structure for command line mode */
|
||||
memset (&ctrl, 0, sizeof ctrl);
|
||||
gpgsm_init_default_ctrl (&ctrl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue