Skip to content
Snippets Groups Projects
Commit 7dd47667 authored by Peter Maydell's avatar Peter Maydell Committed by Anthony Liguori
Browse files

linux-user/elfload.c: Don't memset(NULL..) if malloc() failed


If a malloc() in copy_elf_strings() failed we would call memset()
before the "did malloc fail?" check. Fix this by moving to the
glib alloc/free routines for this memory so we can use g_try_malloc0
rather than having a separate memset(). Spotted by Coverity (see
bug 887883).

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 096685fc
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