summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2019-04-18 16:32:42 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-15 05:32:46 +0000
commitbbcbe0e05ec001d408d1362f893af1b15dc03c83 (patch)
treee55a63793cea10adcd0ecb8dbfefc91fd9197dee
parent5fc1b18b7fcc8c556f745ce1858a4cb9e99a1888 (diff)
downloadbase-bbcbe0e05ec001d408d1362f893af1b15dc03c83.tar.gz
HwBlob: s/malloc/calloc/
Since this blob is passed between processes. We could potentially only memset portions of the blob as it is written to. However, the JHwBlob API itself doesn't have to have writes in order (even though known usages of it do write in order). Because of this, keeping track of which bytes to pad would be too expensive. Bug: 131356202 Test: boot, hidl_test_java Change-Id: I48f4d7cb20c4bfe747dd323ae3744d323ad097c9 Merged-In: I48f4d7cb20c4bfe747dd323ae3744d323ad097c9 (cherry picked from commit d8157bc094569bee74976df2585d632f1793e226)
-rw-r--r--core/jni/android_os_HwBlob.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/jni/android_os_HwBlob.cpp b/core/jni/android_os_HwBlob.cpp
index bb916d2431c5..09589cdb0801 100644
--- a/core/jni/android_os_HwBlob.cpp
+++ b/core/jni/android_os_HwBlob.cpp
@@ -85,7 +85,7 @@ JHwBlob::JHwBlob(JNIEnv *env, jobject thiz, size_t size)
mOwnsBuffer(true),
mHandle(0) {
if (size > 0) {
- mBuffer = malloc(size);
+ mBuffer = calloc(size, 1);
}
}