From 1dc9183bb5125c6d244b076c00ba63c53b5c7ba5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 28 May 2015 02:24:51 +0200 Subject: [PATCH] Use libretrodb_query_free to cleanup query state in database_cursor_open --- database_info.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database_info.c b/database_info.c index cf480f6e74..5defb50627 100644 --- a/database_info.c +++ b/database_info.c @@ -231,10 +231,13 @@ static int database_cursor_open(libretrodb_t *db, if ((libretrodb_cursor_open(db, cur, q)) != 0) goto error; + if (q) + libretrodb_query_free(q); + return 0; error: - if (query) + if (q) libretrodb_query_free(q); query = NULL; libretrodb_close(db);