=== modified file 'plugins.d/mandos-client.c' --- plugins.d/mandos-client.c 2018-02-18 00:40:22 +0000 +++ plugins.d/mandos-client.c 2018-02-18 01:03:48 +0000 @@ -1923,19 +1923,20 @@ return; } } + int devnull = (int)TEMP_FAILURE_RETRY(open("/dev/null", O_RDONLY)); + if(devnull == -1){ + perror_plus("open(\"/dev/null\", O_RDONLY)"); + return; + } int numhooks = scandirat(hookdir_fd, ".", &direntries, runnable_hook, alphasort); if(numhooks == -1){ perror_plus("scandir"); + close(devnull); return; } struct dirent *direntry; int ret; - int devnull = (int)TEMP_FAILURE_RETRY(open("/dev/null", O_RDONLY)); - if(devnull == -1){ - perror_plus("open(\"/dev/null\", O_RDONLY)"); - return; - } for(int i = 0; i < numhooks; i++){ direntry = direntries[i]; if(debug){