From b81570124713939e33ff15ada36704c3409e7fe3 Mon Sep 17 00:00:00 2001 From: Jin Wei Date: Thu, 18 Oct 2012 17:04:21 +0800 Subject: [PATCH] fix valgrind ioctl warning. Initialize local variable to avoid syscall ioctl warning. Change-Id: Ibad5b86cd799f147c71f182d654e61318e2ac15e Origin-Change-Id: Iedf5b128ae1743f633d2821ac3e402942ad6642b Signed-off-by: Jin Wei Signed-off-by: Jian Luo Signed-off-by: Bruce Beare Signed-off-by: Jack Ren Author-tracking-BZ: 62797 --- libcutils/ashmem-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcutils/ashmem-dev.c b/libcutils/ashmem-dev.c index 8b71f87de..3089a942d 100644 --- a/libcutils/ashmem-dev.c +++ b/libcutils/ashmem-dev.c @@ -48,7 +48,7 @@ int ashmem_create_region(const char *name, size_t size) return fd; if (name) { - char buf[ASHMEM_NAME_LEN]; + char buf[ASHMEM_NAME_LEN] = {0}; strlcpy(buf, name, sizeof(buf)); ret = ioctl(fd, ASHMEM_SET_NAME, buf);