fixed problem which could result in strdup(NULL)
authorewt <devnull@localhost>
Tue, 30 Jan 1996 04:12:58 +0000 (04:12 +0000)
committerewt <devnull@localhost>
Tue, 30 Jan 1996 04:12:58 +0000 (04:12 +0000)
CVS patchset: 252
CVS date: 1996/01/30 04:12:58

lib/var.c

index 8d67cb7..ce0cadc 100644 (file)
--- 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;
 }