summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkLayout.c
diff options
context:
space:
mode:
authordas <das>2008-12-07 16:34:55 (GMT)
committerdas <das>2008-12-07 16:34:55 (GMT)
commit213dcc2280beb163541d69f33ed2b1713da728da (patch)
tree51c6425facf14768762c5181fc1e89586539e0a1 /generic/ttk/ttkLayout.c
parentdad5f8c673f46f8a689841cdc0568fff52c5ef87 (diff)
downloadtk-213dcc2280beb163541d69f33ed2b1713da728da.zip
tk-213dcc2280beb163541d69f33ed2b1713da728da.tar.gz
tk-213dcc2280beb163541d69f33ed2b1713da728da.tar.bz2
Fix potential null dereference flagged by clang static analyzer
Diffstat (limited to 'generic/ttk/ttkLayout.c')
-rw-r--r--generic/ttk/ttkLayout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c
index c1e239a..2f599dd 100644
--- a/generic/ttk/ttkLayout.c
+++ b/generic/ttk/ttkLayout.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 2003 Joe English. Freely redistributable.
*
- * $Id: ttkLayout.c,v 1.12 2008/05/23 20:20:05 jenglish Exp $
+ * $Id: ttkLayout.c,v 1.13 2008/12/07 16:34:56 das Exp $
*/
#include <string.h>
@@ -733,7 +733,7 @@ Ttk_LayoutTemplate Ttk_BuildLayoutTemplate(Ttk_LayoutSpec spec)
last = node;
}
- if (spec->opcode & _TTK_CHILDREN) {
+ if (spec->opcode & _TTK_CHILDREN && last) {
int depth = 1;
last->child = Ttk_BuildLayoutTemplate(spec+1);