ctucx.git: nimstagit

[nimlang] incomplete reimplementation of stagit

commit ddd878af68fb33b21fd3a9fd26f366a2012f3ee5
parent 35434674669541673b3e90aad2025ca811a6d2dd
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 23 Mar 2021 22:50:27 +0100

repoGenerator.nim: fix memleak
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/repoGenerator.nim b/src/repoGenerator.nim
@@ -110,10 +110,10 @@ proc generateCommitPage (path: string, templateContext: JsonNode, commit: GitCom
         free(parentTree)
         free(treeId)
 
-    diff.findSimilar(findopts)
-
     free(tree)
 
+    diff.findSimilar(findopts)
+
     let diffStats = diff.stats
 
     commitTemplateContext["filesChanged"] = %diffStats.filesChanged

@@ -161,7 +161,7 @@ proc generateCommitPage (path: string, templateContext: JsonNode, commit: GitCom
             })
 
         free(patch)
-
+    free(diff)
 
     writeFile(
         joinPath(joinPath(path, id & ".html")),