threads / patch / 18679

patchbuiltin-clone.c: no need to strdup for setenv

Subject: [PATCH] builtin-clone.c: no need to strdup for setenv

## tl;dr

One message between Apr 1, 2009 and Apr 1, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ali Gholami Rudi· Apr 1, 2009, 11:22 UTC · lore
The setenv function makes a copy, itself.
Signed-off-by: Ali Gholami Rudi <ali@rudi.ir>
---
 builtin-clone.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to builtin-clone.c +1 −1
diff --git a/builtin-clone.c b/builtin-clone.c
index 0031b5f..28d15bb 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -406,7 +406,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	atexit(remove_junk);
 	sigchain_push_common(remove_junk_on_signal);
 
-	setenv(CONFIG_ENVIRONMENT, xstrdup(mkpath("%s/config", git_dir)), 1);
+	setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
 
 	if (safe_create_leading_directories_const(git_dir) < 0)
 		die("could not create leading directories of '%s'", git_dir);

← back to recent threads