From: Carlos Martín Nieto Date: Mon, 14 Mar 2011 19:18:38 GMT Subject: [PATCH 3/3] clone: Free a few paths Message-ID: <1300130318-11279-4-git-send-email-cmn@elego.de> In-Reply-To: <1300130318-11279-1-git-send-email-cmn@elego.de> Free the path, repo, dir buffers Signed-off-by: Carlos Martín Nieto --- builtin/clone.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 60d9a64..d90770a 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -365,8 +365,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix) { int is_bundle = 0, is_local; struct stat buf; - const char *repo_name, *repo, *work_tree, *git_dir; - char *path, *dir; + const char *repo_name, *work_tree, *git_dir; + char *path, *dir, *repo; int dest_exists; const struct ref *refs, *remote_head; const struct ref *remote_head_points_at; @@ -415,7 +415,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) else if (!strchr(repo_name, ':')) repo = xstrdup(make_absolute_path(repo_name)); else - repo = repo_name; + repo = xstrdup(repo_name); is_local = path && !is_bundle; if (is_local && option_depth) warning("--depth is ignored in local clones; use file:// instead."); @@ -665,6 +665,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) err = run_command_v_opt(argv_submodule, RUN_GIT_CMD); } + free(dir); + free(repo); + free(path); strbuf_release(&reflog_msg); strbuf_release(&branch_top); strbuf_release(&key); -- 1.7.4.1