Close the FD if we can't fdopen it. Found by codesonar
authorAlan T. DeKok <aland@freeradius.org>
Tue, 6 May 2014 15:53:29 +0000 (11:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 6 May 2014 15:54:01 +0000 (11:54 -0400)
src/lib/debug.c

index a8363f5..483fca1 100644 (file)
@@ -558,6 +558,7 @@ int fr_log_talloc_report(TALLOC_CTX *ctx)
        }
        log = fdopen(fd, "w");
        if (!log) {
+               close(fd);
                fr_strerror_printf("Couldn't write memory report, fdopen failed: %s", fr_syserror(errno));
                return -1;
        }