From ac2fa110ea489ca3d1b81e3872731fa1621a6e39 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. Change-Id: I365e114fa6d7abb292dacb6fc702128d046df8f8 BUG: 1339214 Signed-off-by: Soumya Koduri Reviewed-on: http://review.gluster.org/14521 Reviewed-by: Kaleb KEITHLEY Reviewed-by: jiffin tony Thottan Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Niels de Vos CentOS-regression: Gluster Build System --- api/src/glfs-handleops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/src') 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