]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make FD scope smaller to shut up static analysis
authorAlan T. DeKok <aland@freeradius.org>
Mon, 29 May 2017 16:56:02 +0000 (12:56 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 29 May 2017 16:56:02 +0000 (12:56 -0400)
CID #1233595

src/modules/rlm_linelog/rlm_linelog.c

index 1f60f0f27f6e6c2ebd03c2b35f2c4d5b5e2903f6..7ede266a9531eddf70210f4b1569b2fec2bf5df0 100644 (file)
@@ -463,7 +463,6 @@ static size_t linelog_escape_func(UNUSED REQUEST *request,
 static rlm_rcode_t mod_do_linelog(void *instance, UNUSED void *thread, REQUEST *request) CC_HINT(nonnull);
 static rlm_rcode_t mod_do_linelog(void *instance, UNUSED void *thread, REQUEST *request)
 {
-       int                     fd = -1;
        linelog_conn_t          *conn;
        struct timeval          *timeout = NULL;
 
@@ -649,6 +648,7 @@ build_vector:
        switch (inst->log_dst) {
        case LINELOG_DST_FILE:
        {
+               int fd = -1;
                char path[2048];
 
                if (xlat_eval(path, sizeof(path), request, inst->file.name, inst->file.escape_func, NULL) < 0) {