am 86b2ecdd
: Merge "fix mem leak on error handling"
* commit '86b2ecdd311fca2e1e4a3504bf96bb23c5630492': fix mem leak on error handling
This commit is contained in:
commit
255405eb19
@ -1472,6 +1472,8 @@ status_t Parcel::continueWrite(size_t desired)
|
|||||||
if (objectsSize) {
|
if (objectsSize) {
|
||||||
objects = (size_t*)malloc(objectsSize*sizeof(size_t));
|
objects = (size_t*)malloc(objectsSize*sizeof(size_t));
|
||||||
if (!objects) {
|
if (!objects) {
|
||||||
|
free(data);
|
||||||
|
|
||||||
mError = NO_MEMORY;
|
mError = NO_MEMORY;
|
||||||
return NO_MEMORY;
|
return NO_MEMORY;
|
||||||
}
|
}
|
||||||
@ -1552,7 +1554,7 @@ status_t Parcel::continueWrite(size_t desired)
|
|||||||
mError = NO_MEMORY;
|
mError = NO_MEMORY;
|
||||||
return NO_MEMORY;
|
return NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(mDataCapacity == 0 && mObjects == NULL
|
if(!(mDataCapacity == 0 && mObjects == NULL
|
||||||
&& mObjectsCapacity == 0)) {
|
&& mObjectsCapacity == 0)) {
|
||||||
ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired);
|
ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired);
|
||||||
|
Loading…
Reference in New Issue
Block a user