From 7e77e4c026f48137b2320ad07e9834a7b0cddc45 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Fri, 30 Oct 2009 03:40:10 +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(+) diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 130220cd6..82eee2f12 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -795,6 +795,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