msvcrt: fix potential memory leak (found by Smatch) [3/3, resend]

Lionel_Debroux lionel_debroux at yahoo.fr
Thu Sep 27 13:12:34 CDT 2007


_wgetcwd leaks some heap memory in an error paths. Found in Michael
Stefaniuc's list of Wine potential bugs detected by Smatch.
Fixed by mirroring the "else if" already present in _getcwd. This "else"
is correct because the condition of this test evaluates to false if
there was a memory allocation (due to if (size <= dir_len) size =
dir_len + 1; assignment).

Is there anything wrong with this patch ?

2007-09-24  Lionel Debroux <lionel_debroux at yahoo.fr>
        * dlls/msvcrt/dir.c:
        msvcrt: fix potential memory leak (found by Smatch).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-msvcrt-fix-potential-memory-leak-found-by-Smatch.patch
Type: text/x-patch
Size: 790 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070927/2476b3ad/attachment.bin 


More information about the wine-patches mailing list