commit 6ac5a73c42954ae8af288f8fea72927a4e63eab8 from: Stefan Sperling date: Thu Aug 08 23:43:56 2019 UTC plug a small memleak in cmd_commit() commit - 0e444aba90ccdc7b118d81f084b9d4b83a409b92 commit + 6ac5a73c42954ae8af288f8fea72927a4e63eab8 blob - 0476470fdaf1cd3d39c311d297a739bb61922472 blob + 48602a49dc5401bfc8b556e00e54e00dc7ab15e0 --- got/got.c +++ got/got.c @@ -3454,6 +3454,7 @@ cmd_commit(int argc, char *argv[]) struct got_pathlist_head paths; TAILQ_INIT(&paths); + cl_arg.logmsg_path = NULL; while ((ch = getopt(argc, argv, "m:")) != -1) { switch (ch) { @@ -3534,7 +3535,6 @@ cmd_commit(int argc, char *argv[]) cl_arg.branch_name += 11; } cl_arg.repo_path = got_repo_get_path(repo); - cl_arg.logmsg_path = NULL; error = got_worktree_commit(&id, worktree, &paths, got_author, NULL, collect_commit_logmsg, &cl_arg, print_status, NULL, repo); if (error) { @@ -3552,6 +3552,7 @@ cmd_commit(int argc, char *argv[]) goto done; printf("Created commit %s\n", id_str); done: + free(cl_arg.logmsg_path); if (repo) got_repo_close(repo); if (worktree)