]> Git Repo - qemu.git/commit - hw/elf_ops.h
loader: don't call realloc(non_null, 0) when no symbols are present
authorAurelien Jarno <[email protected]>
Mon, 28 Dec 2009 20:18:12 +0000 (21:18 +0100)
committerAurelien Jarno <[email protected]>
Sun, 3 Jan 2010 02:14:37 +0000 (03:14 +0100)
commit3e372cf87fa0d9ab378c3dffed6b863bef4ed7a3
tree1d92499f74d336cbb904979c2fa095129c481fd0
parentb430a22562e8a3836f984aa3f8b5b62ebd249573
loader: don't call realloc(non_null, 0) when no symbols are present

According to C99, realloc(non_null, 0) != free(non_null), that's why
it is forbidden in QEMU.

When there are no symbols, nsyms equals to 0. Free the syms structure
and set it to NULL instead of reallocating it with a size of 0.

This fixes -kernel with stripped kernels.

Signed-off-by: Aurelien Jarno <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
hw/elf_ops.h
This page took 0.025449 seconds and 4 git commands to generate.