close cursor in caps db query

This commit is contained in:
Daniel Gultsch 2016-03-11 09:01:27 +01:00
parent 7eb736227e
commit 9548f43998

View file

@ -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;