Commit Diff


commit - e227880da6b6dbda2bf5abdb2156003ec64a733e
commit + 795c5bd703056e2896698a42d4a0af2a5f636ec5
blob - e0e53c34d3bd7b4b8eda506a82b4b89c8ba4ef36
blob + 5ab097998eac86e1e04477bc4b9b55ab2fdf255b
--- gotweb/gotweb.c
+++ 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;
 }