|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v3 07/10] linux-user: check return value of malloc() |
Date: | Thu, 07 Aug 2014 07:19:02 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
On 08/06/2014 10:01 PM, zhanghailiang wrote: > if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0)) > return -TARGET_EFAULT; > host_mb = malloc(msgsz+sizeof(long)); > + if (!host_mb) { > + return -TARGET_ENOMEM; > + } lock_user allocates memory; returning from the middle leaks it. r~
[Prev in Thread] | Current Thread | [Next in Thread] |