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

Function remalloc_fo

util/intelvbttool/intelvbttool.c:325–343  ·  view source on GitHub ↗

Resize file object and keep memory content */

Source from the content-addressed store, hash-verified

323
324/* Resize file object and keep memory content */
325static struct fileobject *remalloc_fo(struct fileobject *old,
326 const size_t size)
327{
328 struct fileobject *fo = old;
329
330 if (!old || !size)
331 return NULL;
332
333 fo->data = realloc(fo->data, size);
334 if (!fo->data)
335 return NULL;
336
337 if (fo->size < size)
338 memset(&fo->data[fo->size], 0, size - fo->size);
339
340 fo->size = size;
341
342 return fo;
343}
344
345/*
346 * Creates a new subregion copy of fileobject.

Callers 4

read_fileFunction · 0.85
parse_vbtFunction · 0.85
fix_vbios_headerFunction · 0.85
patch_vbiosFunction · 0.85

Calls 2

reallocFunction · 0.85
memsetFunction · 0.50

Tested by

no test coverage detected