Commit 90dce515 authored by Jim Meyering's avatar Jim Meyering Committed by Junio C Hamano

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: default avatarJim Meyering <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent c97038d1
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment