]> source.dussan.org Git - rspamd.git/commitdiff
Fix varargs processing (found by coverity)
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Feb 2016 16:27:29 +0000 (16:27 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 10 Feb 2016 23:10:39 +0000 (23:10 +0000)
src/libutil/sqlite_utils.c

index a1fdd2a8b6a0c771f7a24ea34ada409475194bee..7e80190e34e7103b4977f8e22d0f5d1143cbab64 100644 (file)
@@ -131,7 +131,6 @@ rspamd_sqlite3_run_prstmt (rspamd_mempool_t *pool, sqlite3 *db, GArray *stmts,
                }
        }
 
-       va_end (ap);
        retcode = sqlite3_step (stmt);
 
        if (retcode == nst->result) {
@@ -167,6 +166,8 @@ rspamd_sqlite3_run_prstmt (rspamd_mempool_t *pool, sqlite3 *db, GArray *stmts,
                        sqlite3_reset (stmt);
                }
 
+               va_end (ap);
+
                return SQLITE_OK;
        }
        else if (retcode != SQLITE_DONE && retcode != SQLITE_OK && retcode != SQLITE_ROW) {
@@ -179,6 +180,8 @@ rspamd_sqlite3_run_prstmt (rspamd_mempool_t *pool, sqlite3 *db, GArray *stmts,
                sqlite3_reset (stmt);
        }
 
+       va_end (ap);
+
        return retcode;
 }