summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dace5dd)
raw | patch | inline | side by side (parent: dace5dd)
author | Jeff King <peff@peff.net> | |
Fri, 29 Jan 2010 10:31:30 +0000 (05:31 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Jan 2010 17:56:12 +0000 (09:56 -0800) |
Caught by valgrind in t5516. Reading the code shows we
malloc enough for our string, but not trailing NUL.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
malloc enough for our string, but not trailing NUL.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-push.c | patch | blob | history |
diff --git a/builtin-push.c b/builtin-push.c
index 5df66081a6ff0ca5087ff9a2ac4042d8ec651499..5633f0ade49f7c845665b7aab202be18a8cc9d8d 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
} else if (deleterefs && !strchr(ref, ':')) {
char *delref;
int len = strlen(ref)+1;
- delref = xmalloc(len);
+ delref = xmalloc(len+1);
strcpy(delref, ":");
strcat(delref, ref);
ref = delref;