https://bugs.winehq.org/show_bug.cgi?id=56569
Bug ID: 56569 Summary: There is a memory leak defect at line 231 in the file negotiate.c located at /wine/dlls/secur32/. 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: ---
A pointer variable named new_ctxt is defined at line 212 in the file negotiate.c located at /wine/dlls/secur32/. This pointer allocates a block of dynamic memory using the function calloc at line 225. When the if statement at line 225 evaluates to false, it indicates that the dynamic memory allocation for new_ctxt was successful. However, when the if statement at line 231 evaluates to true, the program returns at line 231, thus skipping the release of the dynamically allocated memory pointed to by new_ctxt at line 316, resulting in a memory leak defect, as illustrated in the diagram below: https://github.com/LuMingYinDetect/wine_defects/blob/main/wine_13.png