]> git.ipfire.org Git - thirdparty/git.git/blobdiff - strbuf.c
use xmallocz to avoid size arithmetic
[thirdparty/git.git] / strbuf.c
index d76f0aed85c4ec6eafdcfd1a8ee2b22d3d20df96..de7a7c273095e4f5907260ddda50bef375381783 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -685,7 +685,7 @@ char *xstrdup_tolower(const char *string)
        size_t len, i;
 
        len = strlen(string);
-       result = xmalloc(len + 1);
+       result = xmallocz(len);
        for (i = 0; i < len; i++)
                result[i] = tolower(string[i]);
        result[i] = '\0';