]> git.proxmox.com Git - mirror_qemu.git/commit
loader: don't call realloc(non_null, 0) when no symbols are present
authorAurelien Jarno <aurelien@aurel32.net>
Mon, 28 Dec 2009 20:18:12 +0000 (21:18 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
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 <aurelien@aurel32.net>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
hw/elf_ops.h