commit 2fbdb5aefebc67efda0c651e17b9094d46633d1a from: Stefan Sperling date: Sat Dec 29 14:54:00 2018 UTC remove useless strdup from got_worktree_get_repo_path() commit - 49520a3227e82d18f80658e593e3300434fa8625 commit + 2fbdb5aefebc67efda0c651e17b9094d46633d1a blob - 80de9bdeca406f8d4266ddd4b98a8a26f59d6df5 blob + 7ffb70af030caa6fdcf0a595f91fe0486870a2c4 --- include/got_worktree.h +++ include/got_worktree.h @@ -42,13 +42,11 @@ void got_worktree_close(struct got_worktree *); /* * Get the path to the repository associated with a worktree. - * The caller must dispose of it with free(3). */ -char *got_worktree_get_repo_path(struct got_worktree *); +const char *got_worktree_get_repo_path(struct got_worktree *); /* * Get the path prefix associated with a worktree. - * The caller must dispose of it with free(3). */ const char *got_worktree_get_path_prefix(struct got_worktree *); blob - c55f3e7519777cdce2a4f25c8e35006404281300 blob + 548c20af49b6c661ceae87626202e65cee99bde8 --- lib/worktree.c +++ lib/worktree.c @@ -370,10 +370,10 @@ got_worktree_close(struct got_worktree *worktree) free(worktree); } -char * +const char * got_worktree_get_repo_path(struct got_worktree *worktree) { - return strdup(worktree->repo_path); + return worktree->repo_path; } const char *