From: Jeff King Date: Mon, 29 Feb 2016 10:02:59 +0000 (-0500) Subject: compat/mingw: brown paper bag fix for 50a6c8e X-Git-Tag: v2.8.0-rc1~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d5b3325e72444d365ded113487d2345c365f6d3;p=git compat/mingw: brown paper bag fix for 50a6c8e Commit 50a6c8e (use st_add and st_mult for allocation size computation, 2016-02-22) fixed up many xmalloc call-sites including ones in compat/mingw.c. But I screwed up one of them, which was half-converted to ALLOC_ARRAY, using a very early prototype of the function. And I never caught it because I don't build on Windows. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/compat/mingw.c b/compat/mingw.c index ae16d089ad..af56c1fe61 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1028,7 +1028,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen free(quoted); } - wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t)); + ALLOC_ARRAY(wargs, st_add(st_mult(2, args.len), 1)); xutftowcs(wargs, args.buf, 2 * args.len + 1); strbuf_release(&args);