On 07/23/2014 02:10 AM, Sam Roberts wrote:
> On Tue, Jul 22, 2014 at 3:19 PM, Fedor Indutny <[email protected]> wrote:
>> I do believe that the most of such code paths are handled. You could ask Ben
>> if you don't believe me.
> 
> Fedor, I have huge confidence in you! No kidding, libuv is solid code,
> and it tries to force it's user to do most of the allocation, as it
> should!
> 
> But libuv#1374 adds a number of such paths, and errors bubble up... In
> my little example, you will note that code coverage would not find the
> memory leak.
> 
> Anyhow, I don't have much stake in this... V8 aborts hard when out of
> memory, take this all as a friendly "there lie dragons"!
> 
> And I just grepped for malloc, about 5 uses in, I find src/unix/aix.c line 
> 308:
> 
> ```
>   ifc.ifc_req = (struct ifreq*)malloc(size);
>   ifc.ifc_len = size;
>   if (ioctl(sockfd, SIOCGIFCONF, &ifc) == -1) {
>     uv__close(sockfd);
>     return -ENOSYS;
>   }
> ```
> 
> I suspect that ioctl() rarely if ever fails, but if it does, this will leak.
> 

Thanks, Sam. That PR was huge, I may have missed a thing or 2...

-- 
Saúl Ibarra Corretgé
bettercallsaghul.com


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to