summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorBarak Sason <bsasonro@redhat.com>2019-08-18 15:36:40 +0300
committerAmar Tumballi <amarts@gmail.com>2019-08-20 16:42:06 +0000
commit72fe2bd9ae0ca223d8a320ca124c2837a1571d82 (patch)
tree2e484f761f5fb14af55b1d9b322d3a7bf89bb055 /api
parentb4b683736367d93daad08a5ee6ca95778c07c5a4 (diff)
api: fixing a coverity issue
Added a null pointer check to avoid seg-fault CID:1403874 Updates: bz#789278 Change-Id: Ia8ff992c9f06d79647089f296afe77519fb5af2a Signed-off-by: Barak Sason <bsasonro@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index e6adea5..7d73e97 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -5924,8 +5924,10 @@ upcall_syncop_args_init(struct glfs *fs, struct gf_upcall *upcall_data)
return args;
out:
if (ret) {
- GF_FREE(args->upcall_data.client_uid);
- GF_FREE(args);
+ if (args) {
+ GF_FREE(args->upcall_data.client_uid);
+ GF_FREE(args);
+ }
}
return NULL;