From ecf3241eb51fbf5264594c65c6bdb7edac31b526 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Tue, 24 May 2016 17:42:06 +0530 Subject: 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 mainline fix - http://review.gluster.org/14521 Change-Id: I365e114fa6d7abb292dacb6fc702128d046df8f8 BUG: 1339226 Signed-off-by: Soumya Koduri Reviewed-on: http://review.gluster.org/14522 NetBSD-regression: NetBSD Build System Reviewed-by: Niels de Vos Smoke: Gluster Build System CentOS-regression: Gluster Build System --- api/src/glfs-handleops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api') diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 721187f8342..af58691bd8b 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -1901,7 +1901,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); -- cgit