aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service_provider.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/service_provider.c b/service_provider.c
index 9445b8a..77edb2a 100644
--- a/service_provider.c
+++ b/service_provider.c
@@ -709,12 +709,14 @@ static uint64_t find_empty_slot(struct service_provider *sp)
int rc = sqlite3_step(st);
+ uint64_t slot = (uint64_t) -1;
+
if(rc == SQLITE_ROW)
- {
- return sqlite3_column_int64(st, 0);
- }
+ slot = sqlite3_column_int64(st, 0);
+
+ sqlite3_finalize(st);
- return (uint64_t) -1;
+ return slot;
}
struct tm_request sp_createfile(struct service_provider *sp,