From 9548f43998a6f49ab8c9672618dbb5553873a456 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 11 Mar 2016 09:01:27 +0100 Subject: close cursor in caps db query --- src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index b975a001..2ce73796 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -415,8 +415,10 @@ public class DatabaseBackend extends SQLiteOpenHelper { Cursor cursor = db.query(ServiceDiscoveryResult.TABLENAME, null, ServiceDiscoveryResult.HASH + "=? AND " + ServiceDiscoveryResult.VER + "=?", selectionArgs, null, null, null); - if (cursor.getCount() == 0) + if (cursor.getCount() == 0) { + cursor.close(); return null; + } cursor.moveToFirst(); ServiceDiscoveryResult result = null; -- cgit v1.2.3