aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server.c5
-rw-r--r--src/storage_sqlite.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c
index f00385f..a1bbbe8 100644
--- a/src/server.c
+++ b/src/server.c
@@ -380,11 +380,9 @@ int server_create(struct server **_server, const struct settings *settings)
if (ret < 0)
goto destroy_worker_queue;
- run_queue_create(&server->run_queue);
-
ret = storage_get_run_queue(&server->storage, &server->run_queue);
if (ret < 0)
- goto destroy_run_queue;
+ goto destroy_storage;
ret = tcp_server_create(&server->tcp_server, settings->port, cmd_dispatcher_handle_conn,
server->cmd_dispatcher);
@@ -410,6 +408,7 @@ destroy_tcp_server:
destroy_run_queue:
run_queue_destroy(&server->run_queue);
+destroy_storage:
storage_destroy(&server->storage);
destroy_worker_queue:
diff --git a/src/storage_sqlite.c b/src/storage_sqlite.c
index eee26fe..e0f0eac 100644
--- a/src/storage_sqlite.c
+++ b/src/storage_sqlite.c
@@ -403,6 +403,8 @@ int storage_sqlite_get_run_queue(struct storage *storage, struct run_queue *queu
if (ret < 0)
return ret;
+ run_queue_create(queue);
+
while (1) {
ret = sqlite_step(stmt);
if (!ret)