Close FD if there's nothing to log. Bug found by Coverity
authorAlan T. DeKok <aland@freeradius.org>
Thu, 6 Sep 2012 09:11:02 +0000 (11:11 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 6 Sep 2012 09:33:25 +0000 (11:33 +0200)
src/modules/rlm_radutmp/rlm_radutmp.c

index 873a3fa..2192c39 100644 (file)
@@ -597,6 +597,7 @@ static int radutmp_checksimul(void *instance, REQUEST *request)
        *login = '\0';
        radius_xlat(login, sizeof(login), inst->username, request, NULL);
        if (!*login) {
+               close(fd);
                return RLM_MODULE_NOOP;
        }