aMule Bug Tracker - aMule
View Issue Details
0001230aMuleMiscpublic2007-12-31 14:322008-01-14 14:24
mr_hyde 
Xaignar 
normalminoralways
resolvedfixed 
SVN 
SVN 
Any
0001230: UPnP: memory leak?
Not really sure but probably there's a potential memory leak in UPnP.cpp.

In fact, in constructor CPUpnpService, three different buffers are dinamically allocated using the new[] operator (these buffers are used as output for function upnpLib.m_UpnpResolveURL), but the delete operator is never called.

To fix this there are different ways:
1) minimalithic: simply add the delete
2) declare (statically, not dinamically) a char array and use it (not an idea of mine: just "copied" from same file, constructor CUPnPDevice).

Here I attached a patch for way 0000002.
Please notice that I don't knwow libupnp and that the memset used to clear the buffer probably are not useful.

The diff is against src/UPnP.cpp of aMule-CVS-20071231.

Bye,
  Mr Hyde
No tags attached.
diff UPnP.cpp.diff (2,505) 2007-12-31 14:32
http://bugs.amule.org/file_download.php?file_id=213&type=bug
Issue History
2007-12-31 14:32mr_hydeNew Issue
2007-12-31 14:32mr_hydeFile Added: UPnP.cpp.diff
2007-12-31 14:32mr_hydeOperating System => Any
2008-01-04 08:51mr_hydeNote Added: 0002484
2008-01-06 14:39XaignarCategoryExternal Conn => Misc
2008-01-14 13:45XaignarStatusnew => acknowledged
2008-01-14 14:24XaignarStatusacknowledged => resolved
2008-01-14 14:24XaignarFixed in Version => SVN
2008-01-14 14:24XaignarResolutionopen => fixed
2008-01-14 14:24XaignarAssigned To => Xaignar
2008-01-14 14:24XaignarNote Added: 0002511

Notes
(0002484)
mr_hyde   
2008-01-04 08:51   
The category is wrong (another mistake of mine), but I'm not able to edit it (even if I'm logged I don't find any "Update Issue" or similar command to edit the post).
(0002511)
Xaignar   
2008-01-14 14:24   
Thanks for reporting. This has now been fixed in SVN.

Cheers.