X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/42bcfe2cae29f375af4cf2cd3ccfa196b77a3946..0d38a62f4c8e92149a5daade98079fb7445b7a0b:/keydb_db2.c?ds=sidebyside diff --git a/keydb_db2.c b/keydb_db2.c index 1303cd8..0c597c4 100644 --- a/keydb_db2.c +++ b/keydb_db2.c @@ -21,6 +21,7 @@ #include "keyid.h" #include "keyindex.h" #include "keystructs.h" +#include "log.h" #include "mem.h" #include "onak-conf.h" #include "parsekey.h" @@ -91,13 +92,15 @@ void initdb(void) &db2_env, &keydbinfo, &db2_keydbfiles[i]); if (ret) { - fprintf(stderr, "Error opening db file %d (errno %d)\n", + logthing(LOGTHING_CRITICAL, + "Error opening db file %d (errno %d)", i, ret); exit(1); } } } else { - fprintf(stderr, "Error initializing db (%d).\n", ret); + logthing(LOGTHING_CRITICAL, "Error initializing db (%d).", + ret); exit(1); } } @@ -183,6 +186,8 @@ int fetch_key(uint64_t keyid, struct openpgp_publickey **publickey, fetchbuf.size = data.size; read_openpgp_stream(buffer_fetchchar, &fetchbuf, &packets); parse_keys(packets, publickey); + free_packet_list(packets); + packets = NULL; } return (!ret);