https://bugs.winehq.org/show_bug.cgi?id=56568
Bug ID: 56568 Summary: There is a memory leak vulnerability in line 909 of the /wine/tools/winegcc/winegcc.c file Product: Wine Version: 9.6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lumingying@bupt.edu.cn Distribution: ---
In the file winegcc.c located at /wine/tools/winegcc/, a pointer variable named libgcc is defined at line 881. On line 907, this variable allocates a block of dynamic memory using the function xmalloc. When the if statement on line 909 evaluates to true, the program returns. During this process, the dynamically allocated memory pointed to by the variable libgcc is neither returned as on line 914 nor freed, thus causing a memory leak defect, as shown in the diagram below: https://github.com/LuMingYinDetect/wine_defects/blob/main/wine_11.png