Commit 1ad23a19181d08e67b98bf4b6bec26b3adcd813d

Thomas de Grivel 2022-08-11T18:39:13

fix memleak in git log nif

diff --git a/c_src/git_nif.c b/c_src/git_nif.c
index 4f99e4c..4833f21 100644
--- a/c_src/git_nif.c
+++ b/c_src/git_nif.c
@@ -485,7 +485,6 @@ static int log_push_rev(struct log_state *s,
       goto error;
     }
  error:
-  git_object_free(obj);
   return res;
 }
 
@@ -536,8 +535,9 @@ static int log_add_revision(struct log_state *s,
       goto error;
     }
   }
-  error:
-    git_object_free(revs.to);
+ error:
+  git_object_free(revs.from);
+  git_object_free(revs.to);
   return res;
 }