Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix db_subscr_ps error handling
......................................................................


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(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: I27e8b46915efd678c72138e250a9cbb4c9c8ac20
Gerrit-PatchSet: 2
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>

Reply via email to