From 49fb0940778b2e5960a5ebbcc287ca4b271a2674 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 18 Dec 2017 19:12:24 +0000 Subject: [PATCH] No need to declare variable name as static in dounsetenv(). Also, drop a redundant call to free() since name is always freed upon return. From Michael W. Bombardieri, with some tweaks by myself. --- bin/csh/func.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/csh/func.c b/bin/csh/func.c index 1a7476343c4..18707bf8084 100644 --- a/bin/csh/func.c +++ b/bin/csh/func.c @@ -1,4 +1,4 @@ -/* $OpenBSD: func.c,v 1.36 2017/12/16 10:27:21 anton Exp $ */ +/* $OpenBSD: func.c,v 1.37 2017/12/18 19:12:24 anton Exp $ */ /* $NetBSD: func.c,v 1.11 1996/02/09 02:28:29 christos Exp $ */ /*- @@ -924,11 +924,9 @@ void /*ARGSUSED*/ dounsetenv(Char **v, struct command *t) { - Char **ep, *p, *n; + Char **ep, *p, *n, *name; int i, maxi; - static Char *name = NULL; - free(name); /* * Find the longest environment variable */ @@ -957,7 +955,6 @@ dounsetenv(Char **v, struct command *t) break; } free(name); - name = NULL; } void -- 2.20.1