axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <samisa_abeysin...@yahoo.com>
Subject Re: SoapDeSerializer::getHeader - Memory leaks from BasicNode allocation?
Date Fri, 03 Sep 2004 10:30:56 GMT
Anybody got any clue on this please???

Samisa...

--- Samisa Abeysinghe <samisa_abeysinghe@yahoo.com> wrote:

> One more question:
> 
> 4. Why malloc? Why not new?
> 
> Samisa...
> 
> --- Samisa Abeysinghe <samisa_abeysinghe@yahoo.com> wrote:
> 
> > Hi All,
> >     It looks to me that the following in src/soap/SoapDeSerializer.cpp (line 237)
causes
> memory
> > leaks
> > 
> >     BasicNode** pNodeList = (BasicNode**) malloc(sizeof(BasicNode*) * 10); 
> > 
> > I have few questions.
> > 
> > 1. Why do we have 10 hardcoded here?
> > 2. Where do we free the memory that is malloced here?
> > 3. As I understand we are trying to read the SOAP headers here and call handlers.
(Am I
> > correct?)
> > Are the HeaderBlock destructor expected to free the memory allocated in above statement?
(If
> yes
> > would all 10 elements be deallocated? - Even if it deallocates all 10, I do not
think it is
> > correct to deallocate individual elements from a chunk of 10 that we have allocated
using
> single
> > malloc)
> > 
> >     Please help to calrify the doubts.
> > 
> > Thanks,
> > Samisa...
> > 
> > 
> > 	
> > 		
> > __________________________________
> > Do you Yahoo!?
> > New and Improved Yahoo! Mail - 100MB free storage!
> > http://promotions.yahoo.com/new_mail 
> > 
> 
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush
> 



		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

Mime
View raw message