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