diff lwlib/lw_expr.c @ 425:67815606c5d9 3.0-beta2

Prevent NULL deref in lw_expr_destroy
author lost@l-w.ca
date Sun, 19 Sep 2010 10:27:47 -0600
parents a741d2e4869f
children d7d7e4dca3e7
line wrap: on
line diff
--- a/lwlib/lw_expr.c	Sun Sep 19 01:55:26 2010 -0600
+++ b/lwlib/lw_expr.c	Sun Sep 19 10:27:47 2010 -0600
@@ -91,6 +91,8 @@
 void lw_expr_destroy(lw_expr_t E)
 {
 	struct lw_expr_opers *o;
+	if (!E)
+		return;
 	for (o = E -> operands; o; o = o -> next)
 		lw_expr_destroy(o -> p);
 	if (E -> type == lw_expr_type_var)