Commit bb787f0904b277323c9eed7a015bad19b89caad3

Stefan Sperling 2019-07-25T14:59:43

fix a double-free in 'got update' error path

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/got/got.c b/got/got.c
index cb74254..809cd0f 100644
--- a/got/got.c
+++ b/got/got.c
@@ -1129,6 +1129,7 @@ cmd_update(int argc, char *argv[])
 	} else {
 		error = resolve_commit_arg(&commit_id, commit_id_str, repo);
 		free(commit_id_str);
+		commit_id_str = NULL;
 		if (error)
 			goto done;
 		error = got_object_id_str(&commit_id_str, commit_id);