Commit a1f69452 by Edward Thomson

git_strndup fix when OOM

parent 57f31f05
......@@ -55,6 +55,9 @@ GIT_INLINE(char *) git__strndup(const char *str, size_t n)
ptr = (char*)git__malloc(length + 1);
if (!ptr)
return NULL;
if (length)
memcpy(ptr, str, length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment