From 5764e29cdc5b7416c8b5f557ac69e945371fdbae Mon Sep 17 00:00:00 2001 From: ewt Date: Tue, 30 Jan 1996 04:12:58 +0000 Subject: [PATCH] fixed problem which could result in strdup(NULL) CVS patchset: 252 CVS date: 1996/01/30 04:12:58 --- lib/var.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/var.c b/lib/var.c index 8d67cb78d..ce0cadca1 100644 --- a/lib/var.c +++ b/lib/var.c @@ -21,5 +21,9 @@ void setVar(int var, char *val) return ; /* XXX should we go harey carey here? */ if (values[var]) free(values[var]); - values[var] = strdup(val); + + if (val) + values[var] = strdup(val); + else + values[var] = NULL; }