Issue 106477 - xmerge: XMergeFilter.cpp: memory leak
Summary: xmerge: XMergeFilter.cpp: memory leak
Status: CLOSED FIXED
Alias: None
Product: xml
Classification: Code
Component: code (show other issues)
Version: DEV300m63
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: dtardon
QA Contact: issues@xml
URL:
Keywords:
Depends on:
Blocks: 106602
  Show dependency tree
 
Reported: 2009-10-30 11:54 UTC by dcb314
Modified: 2009-11-17 16:19 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
heres a fix (1.35 KB, patch)
2009-10-30 12:03 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description dcb314 2009-10-30 11:54:04 UTC
For source code file xmerge/source/activesync/XMergeFilter.cpp, there is
a memory leak for local variable szJavaHome around line 380. 

The source code is

        lRet = ::RegOpenKeyEx(hKey, _T(szCurrentJava), 0, KEY_READ, &hDataKey);
        if (lRet != ERROR_SUCCESS)
        {
                RegCloseKey(hKey);
                return NULL;
        }

Suggest new code

        lRet = ::RegOpenKeyEx(hKey, _T(szCurrentJava), 0, KEY_READ, &hDataKey);
        if (lRet != ERROR_SUCCESS)
        {
                RegCloseKey(hKey);
                delete [] szJavaHome;
                return NULL;
        }
Comment 1 caolanm 2009-10-30 12:03:30 UTC
Created attachment 65792 [details]
heres a fix
Comment 2 caolanm 2009-10-30 12:04:51 UTC
I wonder if this code is built even under windows ?, maybe we can simply remove
the entire dir ?. Anyway, attached is a plausible fix
Comment 3 caolanm 2009-11-06 10:48:36 UTC
I'll take this one of no one objects. cmc->mba: Focus on that build
modularization :-)
Comment 4 caolanm 2009-11-06 10:51:28 UTC
done in cmcfixes66
Comment 5 caolanm 2009-11-10 15:36:19 UTC
reassign for sanity testing
Comment 6 dtardon 2009-11-12 07:36:14 UTC
looks good
Comment 7 caolanm 2009-11-17 16:19:18 UTC
closed, integrated m65