diff options
author | Soumya Koduri <skoduri@redhat.com> | 2016-05-24 17:42:06 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-05-24 11:20:09 -0700 |
commit | eb4bd2444531ad0d347c574e8341afbba8bf143d (patch) | |
tree | 3442ee636201567b3590b6f30a8acc44b2b4b9f4 | |
parent | b00eb38bff09b3fec6a273b7cb84cee3fa581a0d (diff) |
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: 1339228
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/14523
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r-- | 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 fdde2e57568..31e269cc16f 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -1825,7 +1825,8 @@ glfs_h_poll_cache_invalidation (struct glfs *fs, GF_VALIDATE_OR_GOTO ("glfs_h_poll_cache_invalidation", object, 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); |