From 72fe2bd9ae0ca223d8a320ca124c2837a1571d82 Mon Sep 17 00:00:00 2001 From: Barak Sason Date: Sun, 18 Aug 2019 15:36:40 +0300 Subject: 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 --- api/src/glfs-fops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index e6adea5ea9f..7d73e97822d 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; -- cgit