MCPcopy Create free account
hub / github.com/F-Stack/f-stack / reallocf

Function reallocf

freebsd/kern/kern_malloc.c:1007–1015  ·  view source on GitHub ↗

* reallocf: same as realloc() but free memory on failure. */

Source from the content-addressed store, hash-verified

1005 * reallocf: same as realloc() but free memory on failure.
1006 */
1007void *
1008reallocf(void *addr, size_t size, struct malloc_type *mtp, int flags)
1009{
1010 void *mem;
1011
1012 if ((mem = realloc(addr, size, mtp, flags)) == NULL)
1013 free(addr, mtp);
1014 return (mem);
1015}
1016
1017/*
1018 * malloc_size: returns the number of bytes allocated for a request of the

Callers

nothing calls this directly

Calls 2

reallocFunction · 0.70
freeFunction · 0.70

Tested by

no test coverage detected