#2250: Memory leak in ftp
----------------------+---------------------------------------
Reporter: shaha | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: network | Version:
Resolution: | Keywords: wxFTP trivial memory leak
Blocked By: | Blocking:
Patch: 1 |
----------------------+---------------------------------------
Changes (by oneeyeman):
* patch: 0 => 1
Comment:
Vadim,
Replying to [comment:5 vadz]:
> What is being leaked here exactly? I hope you don't mean that
`wxInputStream` itself is, because this would be hardly surprising
considering you don't delete it, as you're supposed to do.
No, of course not.
I'm talking about this:
{{{
diff -bru wxWidgets/src/common/ftp.cpp
/mnt/winxp/wxWidgets/src/common/ftp.cpp
--- wxWidgets/src/common/ftp.cpp 2014-06-14 17:47:19.000000000
-0700
+++ /mnt/winxp/wxWidgets/src/common/ftp.cpp 2014-07-11
02:34:37.546875000 -0700
@@ -769,7 +769,10 @@
wxString tmp_str = wxT("RETR ") + wxURI::Unescape(path);
if ( !CheckCommand(tmp_str, '1') )
+ {
+ delete sock;
return NULL;
+ }
sock = AcceptIfActive(sock);
if ( !sock )
}}}
--
Ticket URL: <
http://trac.wxwidgets.org/ticket/2250#comment:6>