Commit 95e06996c67ce4d97b0aebb3b19ceff6b58c42f9

Stefan Sperling 2019-02-05T15:53:09

fix memleak in previous commit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 27bcbfa..77ab90b 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -759,11 +759,11 @@ diff_fileindex_dir(struct got_fileindex *fileindex,
 
 		if (readdir_r(dir, de, &dep) != 0) {
 			err = got_error_from_errno();
+			free(de);
 			goto done;
 		}
 		if (dep == NULL) {
 			free(de);
-			de = NULL;
 			break;
 		}