From 38a53cd99ea7a92e8bcd237f1faa1b8a48921234 Mon Sep 17 00:00:00 2001 From: Benjamin Beurdouche Date: Wed, 24 Feb 2021 16:09:46 +0000 Subject: Bug 1685880 - Minor fix to prevent unused variable on early return. r=beurdouche Depends on D104418 Differential Revision: https://phabricator.services.mozilla.com/D106144 --- lib/util/secport.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/util/secport.c b/lib/util/secport.c index 7126492fc..c1f0344b1 100644 --- a/lib/util/secport.c +++ b/lib/util/secport.c @@ -730,8 +730,6 @@ int NSS_PutEnv(const char *envVarName, const char *envValue) { SECStatus result = SECSuccess; - char *encoded; - int putEnvFailed; #ifdef _WIN32 PRBool setOK; @@ -748,14 +746,14 @@ NSS_PutEnv(const char *envVarName, const char *envValue) return SECFailure; } #else - encoded = (char *)PORT_ZAlloc(strlen(envVarName) + 2 + strlen(envValue)); + char *encoded = (char *)PORT_ZAlloc(strlen(envVarName) + 2 + strlen(envValue)); if (!encoded) { return SECFailure; } strcpy(encoded, envVarName); strcat(encoded, "="); strcat(encoded, envValue); - putEnvFailed = putenv(encoded); /* adopt. */ + int putEnvFailed = putenv(encoded); /* adopt. */ if (putEnvFailed) { SET_ERROR_CODE -- cgit v1.2.1