From a5fef9e555ec11f33daf18c1f6e773025ad8ef00 Mon Sep 17 00:00:00 2001 From: "Anand H. Krishnan" Date: Mon, 3 Apr 2017 10:49:08 +0530 Subject: [PATCH] Allocate memory for the btable structure In vr_btable_attach, for the btable metadata, we allocate memory only for a pointer, while end up using that memory as a structure. Hence, allocate memory for the whole structrure rather than for the pointer to the structure. Change-Id: Iccf2793a6c3bcac06aed9cfe2011e9364e1f9397 Closes-Bug: #1678704 --- dp-core/vr_btable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dp-core/vr_btable.c b/dp-core/vr_btable.c index 7f949ed4b..8dbcb5199 100644 --- a/dp-core/vr_btable.c +++ b/dp-core/vr_btable.c @@ -181,7 +181,7 @@ vr_btable_attach(struct iovec *iov, unsigned int iov_len, if (iov[0].iov_len % esize) return NULL; - alloc_size = sizeof(struct vr_btable *); + alloc_size = sizeof(struct vr_btable); alloc_size += (sizeof(void *) * iov_len); alloc_size += (sizeof(struct vr_btable_partition) * iov_len);