git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] use xstrdup, not strdup in ll-merge.c
@ 2009-06-14 19:47 Jim Meyering
  2009-06-14 22:03 ` Alex Riesen
  0 siblings, 1 reply; 10+ messages in thread
From: Jim Meyering @ 2009-06-14 19:47 UTC (permalink / raw)
  To: git list


Otherwise, a fluky allocation failure would cause merge
configuration settings to be silently ignored.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 ll-merge.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ll-merge.c b/ll-merge.c
index 31d6f0a..9168958 100644
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -231,7 +231,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;
 	}

@@ -265,7 +265,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;
 	}

@@ -288,14 +288,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;
 	}

--
1.6.3.2.406.gd6a466

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-06-15 15:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-14 19:47 [PATCH] use xstrdup, not strdup in ll-merge.c Jim Meyering
2009-06-14 22:03 ` Alex Riesen
2009-06-15  8:02   ` Jim Meyering
2009-06-15  8:45     ` Alex Riesen
2009-06-15  9:23       ` Jim Meyering
2009-06-15 11:39         ` Alex Riesen
2009-06-15 11:49           ` Jim Meyering
2009-06-15 12:46             ` Alex Riesen
2009-06-15 14:26               ` Shawn O. Pearce
2009-06-15 15:21                 ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).