summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-03-16 20:38:44 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-20 00:21:58 +0000
commit743cf42ac5dfa2661317e73f70b204bde7450ff2 (patch)
tree3db4e33149b6da05bf4b59e0bf08c6e8be1462c3 /src
parent9d27398e5b6ca1f9589118964eca0158608aeaf1 (diff)
fix db_subscr_ps error handling
Reset stmt and return right away on failure to execute. Change-Id: I27e8b46915efd678c72138e250a9cbb4c9c8ac20 Fixes: Coverity Scan CID#164747
Diffstat (limited to 'src')
-rw-r--r--src/db_hlr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/db_hlr.c b/src/db_hlr.c
index 340e7ce..f6ae18f 100644
--- a/src/db_hlr.c
+++ b/src/db_hlr.c
@@ -92,7 +92,8 @@ int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable)
rc = sqlite3_step(stmt); /* execute the statement */
if (rc != SQLITE_DONE) {
LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc);
- rc = -ENOEXEC;
+ db_remove_reset(stmt);
+ return -ENOEXEC;
}
rc = sqlite3_changes(dbc->db); /* verify execution result */