summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-09 22:49:25 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-10 23:43:52 +0200
commite171b00049ecf60fe45076ef69b0885af82411ff (patch)
tree27971bd30b016ad41ecb2a606082a1b9b286e910
parent5e661d05b4f760ebb2c867a578af48f3db998243 (diff)
code undup: use db_remove_reset() in db_auc.c
-rw-r--r--src/db_auc.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/db_auc.c b/src/db_auc.c
index 10c1816..d469920 100644
--- a/src/db_auc.c
+++ b/src/db_auc.c
@@ -60,16 +60,7 @@ int db_update_sqn(struct db_context *dbc, int64_t id,
return -2;
}
- /* remove bindings and reset statement to be re-executed */
- rc = sqlite3_clear_bindings(stmt);
- if (rc != SQLITE_OK) {
- LOGP(DAUC, LOGL_ERROR, "Error clerearing bindings: %d\n", rc);
- }
- rc = sqlite3_reset(stmt);
- if (rc != SQLITE_OK) {
- LOGP(DAUC, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc);
- }
-
+ db_remove_reset(stmt);
return 0;
}
@@ -172,16 +163,7 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi,
ret = -ENOENT;
out:
- /* remove bindings and reset statement to be re-executed */
- rc = sqlite3_clear_bindings(stmt);
- if (rc != SQLITE_OK) {
- LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_clear_bindings(): %d\n", rc);
- }
- rc = sqlite3_reset(stmt);
- if (rc != SQLITE_OK) {
- LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_reset(): %d\n", rc);
- }
-
+ db_remove_reset(stmt);
return ret;
}