http://bugs.winehq.org/show_bug.cgi?id=2849
Summary: potential memory leak in server/window.c, function get_visible_region() Product: Wine Version: 20050310 Platform: Other OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-kernel AssignedTo: wine-bugs@winehq.org ReportedBy: kremenek@cs.stanford.edu
I am a researcher with the Stanford Checking group.
I am performing experiments of our static analysis tool by running it on Wine.
There is a potential memory leak in server/window.c, function get_visible_region().
LINE: 712 --> create_empty_region() transitively calls malloc(), acquiring memory --> from the heap if (top && top != win && (tmp = create_empty_region()) != NULL) { offset_region( region, offset_x, offset_y ); /* make it .. */ while (win != top && win->parent) { if (win->style & WS_CLIPSIBLINGS) {
--> here a NULL value returned by clip_children can trigger "goto error", --> which does not free the region stored in "tmp"
if (!clip_children( win->parent, win, region, 0, 0 )) goto error; if (is_region_empty( region )) break; }
COMMENT: It is not clear to me if clip_children can return NULL under a different case than high memory pressure (it creates a region itself; if that fails it returns NULL). I am not very familiar with the Wine code base.