From: Alan T. DeKok Date: Wed, 17 May 2017 16:15:07 +0000 (-0400) Subject: reduce scope of variable. Found by PVS-Studio X-Git-Tag: release_3_0_14~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67cea3d6b2fd28c5a7dea3de13828577ceb17043;p=thirdparty%2Ffreeradius-server.git reduce scope of variable. Found by PVS-Studio --- diff --git a/src/main/exec.c b/src/main/exec.c index 77fdd2e386f..d5b3a9aca93 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 = '_';