cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Patch to allow GSSAPI authentication to a socks5 server

From: Markus Moeller <huaraz_at_moeller.plus.com>
Date: Sat, 24 Jan 2009 22:01:38 -0000

"Daniel Stenberg" <daniel_at_haxx.se> wrote in message
news:alpine.DEB.1.10.0901242231090.21482_at_yvahk2.pbagnpgbe.fr...
> On Sat, 24 Jan 2009, Markus Moeller wrote:
>
>>> * I added checks for the malloc() calls I could find with returns on
>>> failure. These are not really fine since they will leak memory in case
>>> of failure. Adding proper ways to bail out may require use of a few more
>>> functions than currently.
>>
>> I am not sure if I understand where are you getting at. All allocated
>> memory will be freed before returning on failure (mostly via gss_..
>> calls) .
>
> Because I added uncondtional returns on malloc() failures. Like this
> psuedo code
>
> a = get_resource()
> b = malloc()
> if(!b)
> return CURLE_OUT_OF_MEMORY;
>
> free_resource(a);
>
> return OK;
>
> When malloc() fails, this function leaks memory (the data 'a' points to).
> The patch I posted had this kind of leaks.
>

I think I addressed them by freeing allocated memory, before returning

Markus
> --
>
> / daniel.haxx.se
>
Received on 2009-01-24