From 440634a280e764421db44f5b1693f83c2ae3775f Mon Sep 17 00:00:00 2001 From: David Bensoussan Date: Fri, 20 Oct 2017 12:55:13 +0200 Subject: [PATCH] fix: closes the opened file descriptors --- wiringPi/wiringPi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index 30964b6..1182688 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -733,6 +733,7 @@ int piGpioLayout (void) fprintf (stderr, "to projects@drogon.net. If this is not a Raspberry Pi then you\n") ; fprintf (stderr, "are on your own as wiringPi is designed to support the\n") ; fprintf (stderr, "Raspberry Pi ONLY.\n") ; + fclose(dtcFd); exit (EXIT_FAILURE) ; } @@ -743,6 +744,8 @@ int piGpioLayout (void) if (wiringPiDebug) printf ("piGpioLayoutOops: Returning revision: %d\n", gpioLayout) ; + fclose(dtcFd); + return gpioLayout ; }