summaryrefslogtreecommitdiffstats
path: root/libs/androidfw
diff options
context:
space:
mode:
authorSungmin Choi <sungmin.choi@lge.com>2012-12-21 14:25:38 +0900
committerSungmin Choi <sungmin.choi@lge.com>2013-01-04 09:56:18 +0900
commitbc268b9014f211910e412a7fda96b6394ff2badc (patch)
treebcbaed695f3c808c23e78b74ff970b536db7b30b /libs/androidfw
parent73e243c4d271907d10f10b301b2d6854e1f63fe4 (diff)
downloadframeworks_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.cpp3
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 {