Commit 795c5bd703056e2896698a42d4a0af2a5f636ec5

Tracey Emery 2020-02-17T17:23:16

check for correct opendir

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index e0e53c3..5ab0979 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1629,7 +1629,7 @@ done:
 errored:
 	free(dir_test);
 	if (opened)
-		if (d && closedir(dt) == -1 && error == NULL)
+		if (dt && closedir(dt) == -1 && error == NULL)
 			error = got_error_from_errno("closedir");
 	return error;
 }