From 199162b11afe0e5275f62c65fc82a5bbcc6c9552 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 4 Jul 2019 10:30:56 +0200 Subject: Add omemo_close function We call omemo_init() when starting profanity and should have an omemo_close() at exit. For now we free the fingerprint autocompleter in there. Fixes valgrind: ``` ==13226== 24 bytes in 1 blocks are definitely lost in loss record 2,855 of 6,958 ==13226== at 0x483677F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==13226== by 0x48AD39: autocomplete_new (autocomplete.c:57) ==13226== by 0x4AB89F: omemo_init (omemo.c:127) ==13226== by 0x42C283: _init (profanity.c:206) ==13226== by 0x42BFF3: prof_run (profanity.c:98) ==13226== by 0x4B25E6: main (main.c:172) ``` Regards https://github.com/profanity-im/profanity/issues/1131 --- src/profanity.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/profanity.c') diff --git a/src/profanity.c b/src/profanity.c index a9824729..324aa36d 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -241,6 +241,9 @@ _shutdown(void) #endif #ifdef HAVE_LIBGPGME p_gpg_close(); +#endif +#ifdef HAVE_OMEMO + omemo_close(); #endif chat_log_close(); theme_close(); -- cgit 1.4.1-2-gfad0