From 123c99294b8026ade628e12fa13a850253e28088 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 30 Apr 2007 12:51:02 +0000 Subject: [PATCH] Prepare for upcoming POSIXed putenv() rewrite: don't free memory after putenv() --- usr.bin/su/su.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 76f76b61e64d..26f4a3ef9209 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -567,8 +567,9 @@ export_pam_environment(void) for (pp = environ_pam; *pp != NULL; pp++) { if (ok_to_export(*pp)) - putenv(*pp); - free(*pp); + (void)putenv(*pp); + else + free(*pp); } }