Skip to content
Snippets Groups Projects
Commit 3e372cf8 authored by Aurelien Jarno's avatar Aurelien Jarno
Browse files

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: default avatarAurelien Jarno <aurelien@aurel32.net>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent b430a225
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment