diff options
author | Sungmin Choi <sungmin.choi@lge.com> | 2012-12-21 14:25:38 +0900 |
---|---|---|
committer | Sungmin Choi <sungmin.choi@lge.com> | 2013-01-04 09:56:18 +0900 |
commit | bc268b9014f211910e412a7fda96b6394ff2badc (patch) | |
tree | bcbaed695f3c808c23e78b74ff970b536db7b30b /libs/androidfw | |
parent | 73e243c4d271907d10f10b301b2d6854e1f63fe4 (diff) | |
download | frameworks_base-bc268b9014f211910e412a7fda96b6394ff2badc.zip frameworks_base-bc268b9014f211910e412a7fda96b6394ff2badc.tar.gz frameworks_base-bc268b9014f211910e412a7fda96b6394ff2badc.tar.bz2 |
fix potential memory leak
use delete before return
Change-Id: I5449ad90bb6910f057bd825b722c9803a7343c34
Diffstat (limited to 'libs/androidfw')
-rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index fc2cd9e..683c49f 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -5037,11 +5037,14 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, } else { group = mPackageGroups.itemAt(idx-1); if (group == NULL) { + delete package; return (mError=UNKNOWN_ERROR); } } err = group->packages.add(package); if (err < NO_ERROR) { + delete group; + delete package; return (mError=err); } } else { |