aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2009-06-14 21:47:54 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-14 13:37:14 -0700
commit90dce51584e908232ff279a6c2949ea9855dddf3 (patch)
tree9d1cdacffd4be1c27f1a1ac84c28886d3cb57696
parentc97038d1cfbd98ea258086c417fe4f0c094596d3 (diff)
downloadgit-90dce51584e908232ff279a6c2949ea9855dddf3.tar.gz
git-90dce51584e908232ff279a6c2949ea9855dddf3.tar.xz
use xstrdup, not strdup in ll-merge.c
Otherwise, a fluky allocation failure would cause merge configuration settings to be silently ignored. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--ll-merge.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ll-merge.c b/ll-merge.c
index 9837c842a..e339b8cfa 100644
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -233,7 +233,7 @@ static int read_merge_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "merge.default")) {
if (value)
- default_ll_merge = strdup(value);
+ default_ll_merge = xstrdup(value);
return 0;
}
@@ -267,7 +267,7 @@ static int read_merge_config(const char *var, const char *value, void *cb)
if (!strcmp("name", ep)) {
if (!value)
return error("%s: lacks value", var);
- fn->description = strdup(value);
+ fn->description = xstrdup(value);
return 0;
}
@@ -290,14 +290,14 @@ static int read_merge_config(const char *var, const char *value, void *cb)
* file named by %A, and signal that it has done with zero exit
* status.
*/
- fn->cmdline = strdup(value);
+ fn->cmdline = xstrdup(value);
return 0;
}
if (!strcmp("recursive", ep)) {
if (!value)
return error("%s: lacks value", var);
- fn->recursive = strdup(value);
+ fn->recursive = xstrdup(value);
return 0;
}