got: fix memory leak in print_commit()
diff --git a/got/got.c b/got/got.c
index ed6be66..37ac5ae 100644
--- a/got/got.c
+++ b/got/got.c
@@ -650,6 +650,9 @@ print_commit(struct got_commit_object *commit, struct got_object_id *id,
printf("commit %s%s%s%s\n", id_str, refs_str ? " (" : "",
refs_str ? refs_str : "", refs_str ? ")" : "");
free(id_str);
+ id_str = NULL;
+ free(refs_str);
+ refs_str = NULL;
printf("from: %s\n", got_object_commit_get_author(commit));
committer_time = got_object_commit_get_committer_time(commit);
datestr = get_datestr(&committer_time, datebuf);