AW: Memory leak in HTAccess.c

Sorry, I did only the cut and missed the paste ;)
The malloc'd document is bound to an entityAnchor. I don't know if
we can free this document somewhere in the Libwww or if it is a task
of the application. Jim Marshall asked somthing similar and I suggested
to free the doc before deleting the request in the application:

        entityAnchor=HTRequest_entityAnchor(request);
        if (entityAnchor)
            entityAnchorDocument=HTAnchor_document(entityAnchor);
        if (entityAnchorDocument)
            HT_FREE(entityAnchorDocument);

Any experts out there who can say if this is correct ?

Regards, Heiner

> -----Ursprüngliche Nachricht-----
> Von: jose.kahan@w3.org [mailto:jose.kahan@w3.org]
> Gesendet am: Donnerstag, 27. Juli 2000 16:03
> An: Kallweit, Heiner
> Cc: 'www-lib@w3.org'
> Betreff: Re: Memory leak in HTAccess.c
> 
> In our previous episode, Kallweit, Heiner said:
> > There is a memory leak in HTAccess.c about line 690 when 
> form_url_encode
> > returns a malloc'd pointer that doesn't get freed.
> > Insert a HT_FREE(form_encoded) as shown.
> 
> As shown where? Your mail is missing the example :)
> 
> I can't add it right after because the allocated string is 
> being copied to the
> anchor structure.
> 
> -Jose
> 

Received on Thursday, 27 July 2000 10:22:21 UTC