am 2f55f8ef: Merge "Fix a Cursor leak if cursor doesn\'t have any content" into gingerbread
Merge commit '2f55f8efc28307835b93bff9a0e78a5a76946863' into gingerbread-plus-aosp
* commit '2f55f8efc28307835b93bff9a0e78a5a76946863':
Fix a Cursor leak if cursor doesn't have any content
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;
}