[Bug 16908] New: memory leak in function SetWindowRgn (?)

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Jan 12 16:48:20 CST 2009


http://bugs.winehq.org/show_bug.cgi?id=16908

           Summary: memory leak in function SetWindowRgn (?)
           Product: Wine
           Version: CVS/GIT
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: user32
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: psedov at gmail.com


Wine's implementation of WinAPI function SetWindowRgn
(http://source.winehq.org/git/wine.git/?a=blob;f=dlls/user32/winpos.c;h=d680cc177a6c1ecb4f3ad726402499c8d985f3cb;hb=HEAD#l159):
----------------
if (hrgn)
{
    RGNDATA *data;
    DWORD size;

    if (!(size = GetRegionData( hrgn, 0, NULL ))) return FALSE;
    if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
    if (!GetRegionData( hrgn, size, data ))
    {
        HeapFree( GetProcessHeap(), 0, data );
        return FALSE;
    }
    SERVER_START_REQ( set_window_region )
    {
        req->window = wine_server_user_handle( hwnd );
        req->redraw = (bRedraw != 0);
        if (data->rdh.nCount)
            wine_server_add_data( req, data->Buffer, data->rdh.nCount *
sizeof(RECT) );
        else
            wine_server_add_data( req, &empty_rect, sizeof(empty_rect) );
        ret = !wine_server_call_err( req );
    }
    SERVER_END_REQ;
}
----------------
Variable 'data' points to memory block allocated via WinAPI function HeapAlloc.
But I don't see where that memory block is freed via WinAPI function HeapFree.
Is this a bug (memory leak) or am I just misunderstanding the code?

I posted this question to Google group comp.emulators.ms-windows.wine
(http://groups.google.ru/group/comp.emulators.ms-windows.wine/browse_thread/thread/2a1d76041ec59e48#),
but nobody responded, so I'm re-asking it here.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list