summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-30 03:28:39 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-30 03:37:43 -0700
commit10cddf14e9f7a7446ea48bedb07ee9e7d0f21e4f (patch)
tree6219e902d696ccdcdd1499a1a46db56b71e099ea /libglusterfs
parente6fc0cbe716a18f02891d3911481fdcb121d8840 (diff)
core: Check for NULL to avoid segfault
A segfault as a result of this was observed during tests. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 348 (touch on booster segfaults) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=348
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/inode.c3
1 files changed, 3 insertions, 0 deletions
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;