From e7142e49fd7999d16e8aa977ae26d54a8e219d46 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Wed, 22 Apr 2020 20:54:53 -0400 Subject: [PATCH] Terminate notify before windows This fixes a use after free bug --- src/toxic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/toxic.c b/src/toxic.c index c127f24..23eb0f7 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -173,9 +173,11 @@ void exit_toxic_success(Tox *m) { store_data(m, DATA_FILE); memset(&user_password, 0, sizeof(struct user_password)); + + terminate_notify(); + kill_all_file_transfers(m); kill_all_windows(m); - terminate_notify(); #ifdef AUDIO #ifdef VIDEO