From 10cddf14e9f7a7446ea48bedb07ee9e7d0f21e4f Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Fri, 30 Oct 2009 03:28:39 +0000 Subject: core: Check for NULL to avoid segfault A segfault as a result of this was observed during tests. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 348 (touch on booster segfaults) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=348 --- libglusterfs/src/inode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index e3a090004..b77b8fbd4 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -805,6 +805,9 @@ __dentry_search_arbit (inode_t *inode) dentry_t *dentry = NULL; dentry_t *trav = NULL; + if (!inode) + return NULL; + list_for_each_entry (trav, &inode->dentry_list, inode_list) { if (__is_dentry_hashed (trav)) { dentry = trav; -- cgit