From 60089f6e16afe6760e0db536086cea5c9ddb5b43 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Tue, 24 May 2016 17:42:06 +0530 Subject: [PATCH 169/178] gfapi/upcall: Use GF_CALLOC while allocating variables In 'glfs_h_poll_cache_invalidation', use GF_CALLOC to allocate 'up_inode_arg' to set memory accounting which is used/referred when freeing the same variable in case of any erros. This is backport of below mailine fix - http://review.gluster.org/14521 http://review.gluster.org/#/c/14522/ (release-3.7) Change-Id: I365e114fa6d7abb292dacb6fc702128d046df8f8 BUG: 1339208 Signed-off-by: Soumya Koduri Reviewed-on: https://code.engineering.redhat.com/gerrit/75110 Reviewed-by: Jiffin Thottan Reviewed-by: Niels de Vos Tested-by: Niels de Vos --- api/src/glfs-handleops.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 72aa7de..77b8a6a 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -1903,7 +1903,8 @@ glfs_h_poll_cache_invalidation (struct glfs *fs, goto out; } - up_inode_arg = calloc (1, sizeof (struct callback_inode_arg)); + up_inode_arg = GF_CALLOC (1, sizeof (struct callback_inode_arg), + glfs_mt_upcall_entry_t); GF_VALIDATE_OR_GOTO ("glfs_h_poll_cache_invalidation", up_inode_arg, out); -- 1.7.1