Review at  https://gerrit.osmocom.org/2108

fix db_subscr_ps error handling

Reset stmt and return right away on failure to execute.

Change-Id: I27e8b46915efd678c72138e250a9cbb4c9c8ac20
Fixes: Coverity Scan CID#164747
---
M src/db_hlr.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/08/2108/1

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 @@
        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 */

-- 
To view, visit https://gerrit.osmocom.org/2108
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27e8b46915efd678c72138e250a9cbb4c9c8ac20
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <[email protected]>

Reply via email to