[Bug 54458] New: vbscript memory leaks in Global_Split
https://bugs.winehq.org/show_bug.cgi?id=54458 Bug ID: 54458 Summary: vbscript memory leaks in Global_Split Product: Wine Version: 7.21 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs(a)winehq.org Reporter: jsm174(a)gmail.com Distribution: --- While porting Visual Pinball to cross platform, I started using XCode Instruments to find some outstanding memory leaks. There appears to be a memory leak in Global_Split. The BSTRs that get copied from "var" into the SafeArray using VariantCopyInd are never freed. The following code changes fix this: for (i = 0; i < count; i++) { str = SysAllocStringLen(string + start, indices[i] - start); if (!str) { hres = E_OUTOFMEMORY; break; } V_VT(&var) = VT_BSTR; V_BSTR(&var) = str; hres = VariantCopyInd(data+i, &var); if(FAILED(hres)) { SafeArrayUnaccessData(sa); SysFreeString(str); goto error; } start = indices[i]+delimiterlen; SysFreeString(str); } -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 --- Comment #1 from Nikolay Sivov <bunglehead(a)gmail.com> --- This looks correct, but you could have a single free call right after VariantCopyInd(). -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 --- Comment #2 from Jason Millard <jsm174(a)gmail.com> --- Perfect. If I were to submit an MR for this, how would one go about a test case? -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 --- Comment #3 from Nikolay Sivov <bunglehead(a)gmail.com> --- For tests we only need to make sure that Split() is tested at all. Then to detect leaks the tests are executed using some leak detection tool. With wine I know people are using valgrind on Linux. I don't know how well it works with current wine/valgrind. But basically, there is no direct support to detect such issues in our tests, you only need to make sure functionality is executed, so the test can potentially trigger the leak. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 --- Comment #4 from Jason Millard <jsm174(a)gmail.com> --- Fixed with https://gitlab.winehq.org/wine/wine/-/merge_requests/2131 -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 Jason Millard <jsm174(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #5 from Jason Millard <jsm174(a)gmail.com> --- Resolved. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 --- Comment #6 from Nikolay Sivov <bunglehead(a)gmail.com> --- Please mention final commits ids when resolving bugs: https://source.winehq.org/git/wine.git/commit/f8b76d3da549f8f08a0413de438f92... https://source.winehq.org/git/wine.git/commit/a6847dd9fb3d9ce876e59e776b2a17... -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f8b76d3da549f8f08a0413de438 | |f929702a380af -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 8.2. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x -- 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.
https://bugs.winehq.org/show_bug.cgi?id=54458 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |--- --- Comment #8 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 8.0.x milestone from bug fixes included in 8.0.1. -- 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.
participants (1)
-
WineHQ Bugzilla