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

Zdenek Kabelac <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <35485b7f7c5850e5a8bd1cb934f7a01efbf6fd46.1287994530.git.zkabelac@redhat.com>
clang seems to be happier with this check.

Signed-off-by: Zdenek Kabelac <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.