summaryrefslogtreecommitdiff
path: root/builtin-fmt-merge-msg.c
diff options
context:
space:
mode:
authorJonas Fonseca <fonseca@diku.dk>2006-09-01 00:32:39 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-31 16:24:39 -0700
commit2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5 (patch)
tree4fac98b5cb3155365498f5750f9550be977660ed /builtin-fmt-merge-msg.c
parentef1186228d39af29c109785fa752e3866c79a6b3 (diff)
downloadgit-2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5.tar.gz
Use xmalloc instead of malloc
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-fmt-merge-msg.c')
-rw-r--r--builtin-fmt-merge-msg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index 76d22b47ba..ed59e77e19 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -140,14 +140,14 @@ static int handle_line(char *line)
if (!strcmp(".", src) || !strcmp(src, origin)) {
int len = strlen(origin);
if (origin[0] == '\'' && origin[len - 1] == '\'') {
- char *new_origin = malloc(len - 1);
+ char *new_origin = xmalloc(len - 1);
memcpy(new_origin, origin + 1, len - 2);
new_origin[len - 1] = 0;
origin = new_origin;
} else
origin = strdup(origin);
} else {
- char *new_origin = malloc(strlen(origin) + strlen(src) + 5);
+ char *new_origin = xmalloc(strlen(origin) + strlen(src) + 5);
sprintf(new_origin, "%s of %s", origin, src);
origin = new_origin;
}
@@ -214,7 +214,7 @@ static void shortlog(const char *name, unsigned char *sha1,
if (eol) {
int len = eol - bol;
- oneline = malloc(len + 1);
+ oneline = xmalloc(len + 1);
memcpy(oneline, bol, len);
oneline[len] = 0;
} else