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
1 changed files with 3 additions and 1 deletions

View File

@ -415,8 +415,10 @@ public class DatabaseBackend extends SQLiteOpenHelper {
Cursor cursor = db.query(ServiceDiscoveryResult.TABLENAME, null, Cursor cursor = db.query(ServiceDiscoveryResult.TABLENAME, null,
ServiceDiscoveryResult.HASH + "=? AND " + ServiceDiscoveryResult.VER + "=?", ServiceDiscoveryResult.HASH + "=? AND " + ServiceDiscoveryResult.VER + "=?",
selectionArgs, null, null, null); selectionArgs, null, null, null);
if (cursor.getCount() == 0) if (cursor.getCount() == 0) {
cursor.close();
return null; return null;
}
cursor.moveToFirst(); cursor.moveToFirst();
ServiceDiscoveryResult result = null; ServiceDiscoveryResult result = null;