Merge "Fix a Cursor leak if cursor doesn't have any content" into gingerbread
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index a53f469..719bb25 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -2687,8 +2687,11 @@
new String[] {Phone._ID, Phone.NUMBER, Phone.IS_SUPER_PRIMARY,
RawContacts.ACCOUNT_TYPE, Phone.TYPE, Phone.LABEL},
Data.MIMETYPE + "=?", new String[] {Phone.CONTENT_ITEM_TYPE}, null);
- if (c != null && c.moveToFirst()) {
- return c;
+ if (c != null) {
+ if (c.moveToFirst()) {
+ return c;
+ }
+ c.close();
}
return null;
}