about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-12-28 17:28:18 -0500
committerJune McEnroe <june@causal.agency>2021-12-28 17:28:18 -0500
commitca50ef458987dca1ed29816fce974684e04e35a7 (patch)
tree8ee97eff999e889bdaf302f988bb7323bcc9bee1
parentImport refactored xdg.c from pounce (diff)
downloadlitterbox-ca50ef458987dca1ed29816fce974684e04e35a7.tar.gz
litterbox-ca50ef458987dca1ed29816fce974684e04e35a7.zip
Close database before calling tls_close(3)
Calling tls_close(3) after an error potentially results in a SIGPIPE,
preventing dbClose() from being called.
Diffstat (limited to '')
-rw-r--r--litterbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/litterbox.c b/litterbox.c
index 5d48b7a..24d5733 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -752,8 +752,8 @@ static void handle(struct Message *msg) {
 }
 
 static void atExit(void) {
-	if (client) tls_close(client);
 	dbClose();
+	if (client) tls_close(client);
 }
 
 static void quit(int sig) {