From 67cea3d6b2fd28c5a7dea3de13828577ceb17043 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 17 May 2017 12:15:07 -0400 Subject: [PATCH] reduce scope of variable. Found by PVS-Studio --- src/main/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/exec.c b/src/main/exec.c index 77fdd2e..d5b3a9a 100644 --- a/src/main/exec.c +++ b/src/main/exec.c @@ -86,7 +86,6 @@ pid_t radius_start_program(char const *cmd, REQUEST *request, bool exec_wait, VALUE_PAIR *input_pairs, bool shell_escape) { #ifndef __MINGW32__ - char *p; VALUE_PAIR *vp; int n; int to_child[2] = {-1, -1}; @@ -169,6 +168,8 @@ pid_t radius_start_program(char const *cmd, REQUEST *request, bool exec_wait, */ snprintf(buffer, sizeof(buffer), "%s=", vp->da->name); if (shell_escape) { + char *p; + for (p = buffer; *p != '='; p++) { if (*p == '-') { *p = '_'; -- 2.1.4