Commit 15760c59 by Ben Straub

Use malloc rather than calloc

parent c4beee76
...@@ -64,8 +64,9 @@ GIT_INLINE(char *) git__strndup(const char *str, size_t n) ...@@ -64,8 +64,9 @@ GIT_INLINE(char *) git__strndup(const char *str, size_t n)
/* NOTE: This doesn't do null or '\0' checking. Watch those boundaries! */ /* NOTE: This doesn't do null or '\0' checking. Watch those boundaries! */
GIT_INLINE(char *) git__substrdup(const char *start, size_t n) GIT_INLINE(char *) git__substrdup(const char *start, size_t n)
{ {
char *ptr = (char*)git__calloc(n+1, sizeof(char)); char *ptr = (char*)git__malloc(n+1);
memcpy(ptr, start, n); memcpy(ptr, start, n);
ptr[n] = '\0';
return ptr; return ptr;
} }
......
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