miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

There is a memory leak

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs
View previous topic :: View next topic  
Author Message
haibo344



Joined: 03 Aug 2012
Posts: 1
Location: China

PostPosted: Fri Aug 03, 2012 9:54 am    Post subject: There is a memory leak Reply with quote

There is a memory leak in function UPNP_GetValidIGD(). desc[i].xml is not freed.

Index: upnp/miniupnpc.c
===================================================================
--- upnp/miniupnpc.c (revision 22)
+++ upnp/miniupnpc.c (working copy)
@@ -550,8 +550,7 @@
memset(data, 0, sizeof(struct IGDdatas));
memset(urls, 0, sizeof(struct UPNPUrls));
parserootdesc(desc[i].xml, desc[i].size, data);
+ free(desc[i].xml);
+ desc[i].xml = 0;
if(0==strcmp(data->CIF.servicetype,
"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1")
|| state >= 3 )
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1469

PostPosted: Sat Aug 11, 2012 5:32 am    Post subject: Reply with quote

Indeed.
Thank you for reporting this!
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1469

PostPosted: Thu Aug 30, 2012 10:09 am    Post subject: Reply with quote

fixed in this version :
miniupnpc-1.7.20120830.tar.gz
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.