From 80ddf4aecf2b865e4d4bb5f9f621b51c34a44122 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 12 Dec 2014 21:23:22 +0100 Subject: [PATCH] sticker/Database: always invoke sqlite3_reset() and sqlite3_clear_bindings() --- src/sticker/StickerDatabase.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sticker/StickerDatabase.cxx b/src/sticker/StickerDatabase.cxx index fd5cbd3ae..69415bd04 100644 --- a/src/sticker/StickerDatabase.cxx +++ b/src/sticker/StickerDatabase.cxx @@ -251,14 +251,14 @@ sticker_insert_value(const char *type, const char *uri, if (!BindAll(stmt, type, uri, name, value)) return false; - if (!ExecuteCommand(stmt)) - return false; + bool success = ExecuteCommand(stmt); sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); - idle_add(IDLE_STICKER); - return true; + if (success) + idle_add(IDLE_STICKER); + return success; } bool