MCPcopy Create free account
hub / github.com/git/git / xmemdupz

Function xmemdupz

wrapper.c:111–114  ·  view source on GitHub ↗

* xmemdupz() allocates (len + 1) bytes of memory, duplicates "len" bytes of * "data" to the allocated memory, zero terminates the allocated memory, * and returns a pointer to the allocated memory. If the allocation fails, * the program dies. */

Source from the content-addressed store, hash-verified

109 * the program dies.
110 */
111void *xmemdupz(const void *data, size_t len)
112{
113 return memcpy(xmallocz(len), data, len);
114}
115
116char *xstrndup(const char *str, size_t len)
117{

Callers 15

git_config_push_envFunction · 0.85
parse_tag_bufferFunction · 0.85
setup_bare_git_dirFunction · 0.85
getpw_strFunction · 0.85
parse_ref_filter_atomFunction · 0.85
copy_lineFunction · 0.85
copy_nameFunction · 0.85
copy_emailFunction · 0.85
grab_sub_body_contentsFunction · 0.85
rstrip_ref_componentsFunction · 0.85
credential_from_url_1Function · 0.85

Calls 1

xmalloczFunction · 0.85

Tested by 3

parse_long_magicFunction · 0.68
match_pathspec_attrsFunction · 0.68