diff options
author | Soumya Koduri <skoduri@redhat.com> | 2016-05-24 17:42:06 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-05-25 04:39:32 -0700 |
commit | ecf3241eb51fbf5264594c65c6bdb7edac31b526 (patch) | |
tree | a2fdf2d68f6ce7195d03f08c1c5c4b9442a4ee47 | |
parent | 8da90277f5f80ffffaa3e9f9ccee6f90c293cc03 (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: 1339226
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/14522
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 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); |