]> git.proxmox.com Git - mirror_qemu.git/commit - bsd-user/elfload.c
bsd-user: Fix possible memory leaks and wrong realloc call
authorStefan Weil <weil@mail.berlios.de>
Sun, 16 Jan 2011 15:28:20 +0000 (16:28 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Mon, 17 Jan 2011 20:23:47 +0000 (20:23 +0000)
commit29718712eb2e53c09d28f08e39f6514d690f6fd3
tree76f3b5c5e368ff2d4fee69cd3a44bfcf0d2f80cb
parent07d8a50cb0e096c5cdc5a81b8030e40833664dd3
bsd-user: Fix possible memory leaks and wrong realloc call

These errors were reported by cppcheck:

[bsd-user/elfload.c:1108]: (error) Common realloc mistake: "syms" nulled but not freed upon failure
[bsd-user/elfload.c:1076]: (error) Memory leak: s
[bsd-user/elfload.c:1079]: (error) Memory leak: syms

v2:
* The previous fix for memory leaks was incomplete (thanks to Peter Maydell for te hint).
* Fix wrong realloc usage, too.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
bsd-user/elfload.c