From c9008fe6a1a4d9c25c4b11804bcc9e5b6edf9bec Mon Sep 17 00:00:00 2001 From: Lalatendu Mohanty Date: Tue, 14 Jan 2014 12:35:54 +0530 Subject: libgfapi: Fixing possible dereferencing of null pointer "glfd" Fix: Putting a check so that pointer derefrence does not happen when "gfld" is null Change-Id: I281b10be445bbeec3a2728fc139d5ac94372e5b6 BUG: 789278 Signed-off-by: Lalatendu Mohanty Reviewed-on: http://review.gluster.org/6697 Tested-by: Gluster Build System Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Vijay Bellur --- api/src/glfs-fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index b09dd90f7..5ea54567d 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1790,7 +1790,7 @@ out: if (ret && glfd) { glfs_fd_destroy (glfd); glfd = NULL; - } else { + } else if (glfd) { fd_bind (glfd->fd); glfs_fd_bind (glfd); } -- cgit