Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#5074 closed Bug report (fixed)

Some memory leaks

Reported by: silamantex Owned by:
Priority: normal Component: FileZilla Server
Keywords: 0.9.33 Cc: eyebex@…
Component version: Operating system type: Windows
Operating system version:

Description

Hi,

Have you tried cppcheck?
http://sourceforge.net/projects/cppcheck/

FileZilla Server\source\interface\misc\md5.cpp:252]: (error) Memory leak: s
FileZilla Server\source\interface\misc\md5.cpp:269]: (error) Memory leak: s
FileZilla Server\source\interface\misc\MarkupSTL.cpp:136]: (error) Mismatching allocation and deallocation: pBuffer
FileZilla Server\source\misc\MarkupSTL.cpp:145]: (error) Mismatching allocation and deallocation: pBuffer
FileZilla Server\source\misc\md5.cpp:261]: (error) Memory leak: s
FileZilla Server\source\misc\md5.cpp:278]: (error) Memory leak: s

Good luck

Attachments (1)

FZS-FixMD5MemLeak.patch (778 bytes ) - added by eyebex 14 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by eyebex, 14 years ago

Cc: eyebex@… added
Resolution: fixed
Status: newclosed

Please double-check such automated findings before posting them here. Most of the above mentioned code is OK and has no leaks: The memory allocated in those functions gets properly deleted by the caller. However, I believe there's a leak in md5.cpp itself, see the attached patch.

by eyebex, 14 years ago

Attachment: FZS-FixMD5MemLeak.patch added

comment:2 by eyebex, 14 years ago

Resolution: fixed
Status: closedreopened

Sorry, I should not set this to fixed until the patch is applied / accepted.

comment:3 by Tim Kosse, 14 years ago

Resolution: fixed
Status: reopenedclosed

comment:4 by eyebex, 14 years ago

Resolution: fixed
Status: closedreopened

While your changes seem to address false positives reported by cppcheck and / or the VS static code analyzer, they do not seem to address the issue I've found manually (and submitted the patch for): IMHO the char array "s" allocated by hex_digest() still does not get freed if used in "operator<<". If I'm wrong, please elaborate and close again. Thank you!

comment:5 by Tim Kosse, 14 years ago

Resolution: fixed
Status: reopenedclosed

Then, through manual analysis, you should have noticed that all those leaks are in dead third-party code that isn't even used.

Note: See TracTickets for help on using tickets.