Commit 11ce22a1a15a25df1218e6cd79c7c0ff7e951b63

Omar Polo 2022-06-15T12:50:10

plug memory and fd leak in got patch

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/patch.c b/lib/patch.c
index 133f045..7e67a84 100644
--- a/lib/patch.c
+++ b/lib/patch.c
@@ -687,6 +687,8 @@ done:
 	free(template);
 	if (tmppath != NULL)
 		unlink(tmppath);
+	if (tmp != NULL)
+		fclose(tmp);
 	free(tmppath);
 	free(oldpath);
 	free(newpath);