[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 11/30] Fix theoretical usage of NULL pointer dereference



clang seems to be happier with this check.

Signed-off-by: Zdenek Kabelac <zkabelac redhat com>
---
 libdm/regex/ttree.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libdm/regex/ttree.c b/libdm/regex/ttree.c
index ec97c98..0ad40bd 100644
--- a/libdm/regex/ttree.c
+++ b/libdm/regex/ttree.c
@@ -97,7 +97,9 @@ int ttree_insert(struct ttree *tt, unsigned int *key, void *data)
 			}
 		}
 	}
-	(*c)->data = data;
+
+	if (*c)
+		(*c)->data = data;
 
 	return 1;
 }
-- 
1.7.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]