From 3fe4146e24b3830f2a6a5d8c5d4bbb0e2f256070 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 19 Jan 2011 09:31:31 +0100 Subject: [PATCH] Bugfix: fix crash in tree_flatten (Thanks mseed) --- src/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tree.c b/src/tree.c index 721e0b9c..48a25eb2 100644 --- a/src/tree.c +++ b/src/tree.c @@ -525,7 +525,7 @@ void tree_flatten(Con *con) { /* Ensure it got only one child */ child = TAILQ_FIRST(&(con->nodes_head)); - if (TAILQ_NEXT(child, nodes) != NULL) + if (child == NULL || TAILQ_NEXT(child, nodes) != NULL) goto recurse; /* The child must have a different orientation than the con but the same as -- 2.39.5