summaryrefslogtreecommitdiffstats
path: root/libs/binder
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@android.com>2013-05-30 14:23:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-30 14:23:58 -0700
commitaf0f8c0a56b1b6b7fe20f34f04e0e15b518fb494 (patch)
tree44c3d315f5922f1c750cc77358493f2c4f87699d /libs/binder
parentfa7d40331cecfd89630440cb2fd20a918dc2d0f5 (diff)
parent255405eb19e6a3fa7f7bb4de9b07beacdf65ece9 (diff)
downloadframeworks_native-af0f8c0a56b1b6b7fe20f34f04e0e15b518fb494.zip
frameworks_native-af0f8c0a56b1b6b7fe20f34f04e0e15b518fb494.tar.gz
frameworks_native-af0f8c0a56b1b6b7fe20f34f04e0e15b518fb494.tar.bz2
am 255405eb: am 86b2ecdd: Merge "fix mem leak on error handling"
* commit '255405eb19e6a3fa7f7bb4de9b07beacdf65ece9': fix mem leak on error handling
Diffstat (limited to 'libs/binder')
-rw-r--r--libs/binder/Parcel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index aa19d17..359742c 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1473,6 +1473,8 @@ status_t Parcel::continueWrite(size_t desired)
if (objectsSize) {
objects = (size_t*)malloc(objectsSize*sizeof(size_t));
if (!objects) {
+ free(data);
+
mError = NO_MEMORY;
return NO_MEMORY;
}
@@ -1553,7 +1555,7 @@ status_t Parcel::continueWrite(size_t desired)
mError = NO_MEMORY;
return NO_MEMORY;
}
-
+
if(!(mDataCapacity == 0 && mObjects == NULL
&& mObjectsCapacity == 0)) {
ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired);