Revision 7267c094 hw/fw_cfg.c
b/hw/fw_cfg.c | ||
---|---|---|
177 | 177 |
/* probing the file */ |
178 | 178 |
fp = probe_splashfile(filename, &file_size, &file_type); |
179 | 179 |
if (fp == NULL) { |
180 |
qemu_free(filename);
|
|
180 |
g_free(filename);
|
|
181 | 181 |
return; |
182 | 182 |
} |
183 | 183 |
/* loading file data */ |
184 | 184 |
if (boot_splash_filedata != NULL) { |
185 |
qemu_free(boot_splash_filedata);
|
|
185 |
g_free(boot_splash_filedata);
|
|
186 | 186 |
} |
187 |
boot_splash_filedata = qemu_malloc(file_size);
|
|
187 |
boot_splash_filedata = g_malloc(file_size);
|
|
188 | 188 |
boot_splash_filedata_size = file_size; |
189 | 189 |
fseek(fp, 0L, SEEK_SET); |
190 | 190 |
fop_ret = fread(boot_splash_filedata, 1, file_size, fp); |
... | ... | |
203 | 203 |
fw_cfg_add_file(s, "bootsplash.bmp", |
204 | 204 |
boot_splash_filedata, boot_splash_filedata_size); |
205 | 205 |
} |
206 |
qemu_free(filename);
|
|
206 |
g_free(filename);
|
|
207 | 207 |
} |
208 | 208 |
} |
209 | 209 |
|
... | ... | |
385 | 385 |
{ |
386 | 386 |
uint16_t *copy; |
387 | 387 |
|
388 |
copy = qemu_malloc(sizeof(value));
|
|
388 |
copy = g_malloc(sizeof(value));
|
|
389 | 389 |
*copy = cpu_to_le16(value); |
390 | 390 |
return fw_cfg_add_bytes(s, key, (uint8_t *)copy, sizeof(value)); |
391 | 391 |
} |
... | ... | |
394 | 394 |
{ |
395 | 395 |
uint32_t *copy; |
396 | 396 |
|
397 |
copy = qemu_malloc(sizeof(value));
|
|
397 |
copy = g_malloc(sizeof(value));
|
|
398 | 398 |
*copy = cpu_to_le32(value); |
399 | 399 |
return fw_cfg_add_bytes(s, key, (uint8_t *)copy, sizeof(value)); |
400 | 400 |
} |
... | ... | |
403 | 403 |
{ |
404 | 404 |
uint64_t *copy; |
405 | 405 |
|
406 |
copy = qemu_malloc(sizeof(value));
|
|
406 |
copy = g_malloc(sizeof(value));
|
|
407 | 407 |
*copy = cpu_to_le64(value); |
408 | 408 |
return fw_cfg_add_bytes(s, key, (uint8_t *)copy, sizeof(value)); |
409 | 409 |
} |
... | ... | |
436 | 436 |
|
437 | 437 |
if (!s->files) { |
438 | 438 |
int dsize = sizeof(uint32_t) + sizeof(FWCfgFile) * FW_CFG_FILE_SLOTS; |
439 |
s->files = qemu_mallocz(dsize);
|
|
439 |
s->files = g_malloc0(dsize);
|
|
440 | 440 |
fw_cfg_add_bytes(s, FW_CFG_FILE_DIR, (uint8_t*)s->files, dsize); |
441 | 441 |
} |
442 | 442 |
|
Also available in: Unified diff