MCPcopy Create free account
hub / github.com/coreboot/coreboot / malloc_fo

Function malloc_fo

util/intelvbttool/intelvbttool.c:296–313  ·  view source on GitHub ↗

* Alloc a file object of given size. * Returns NULL on error. */

Source from the content-addressed store, hash-verified

294 * Returns NULL on error.
295 */
296static struct fileobject *malloc_fo(const size_t size)
297{
298 struct fileobject *fo;
299 if (!size)
300 return NULL;
301
302 fo = malloc(sizeof(*fo));
303 if (!fo)
304 return NULL;
305 fo->data = malloc(size);
306 if (!fo->data) {
307 free(fo);
308 return NULL;
309 }
310 fo->size = size;
311
312 return fo;
313}
314
315/* Free a fileobject structure */
316static void free_fo(struct fileobject *fo)

Callers 3

malloc_fo_subFunction · 0.85
read_fileFunction · 0.85
read_physmemFunction · 0.85

Calls 2

mallocFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected