diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-03-11 09:01:27 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-03-11 09:01:27 +0100 |
commit | 9548f43998a6f49ab8c9672618dbb5553873a456 (patch) | |
tree | 4da633b75e783245eacaba861acd6df88db08aef /src/main/java/eu/siacs/conversations | |
parent | 7eb736227e63985e163bd9ef08a71d8b78c4d3bf (diff) |
close cursor in caps db query
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java | 4 |
1 files changed, 3 insertions, 1 deletions
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; |