diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-24 20:59:02 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-24 20:59:02 +0000 |
commit | 2b16e35b59294f62e9486a77d16477498a0dc78e (patch) | |
tree | e8c42c17eda47a4ab8f74633c3d2528938f90c0d /plugins/NewsAggregator/Src | |
parent | d78cfb7fbc8764337478b462c1c770db6161ed58 (diff) |
NewsAggregator:
-Fixed another memory leak
git-svn-id: http://svn.miranda-ng.org/main/trunk@11902 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src')
-rw-r--r-- | plugins/NewsAggregator/Src/ExportImport.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 9eccb063c5..78e58a8ffe 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -243,7 +243,6 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int bytesParsed = 0;
HXML hXml = xi.parseFile(FileName, &bytesParsed, NULL);
if(hXml != NULL) {
- BYTE isTextUTF = 0;
HXML node = xi.getChildByPath(hXml, _T("opml/body/outline"), 0);
if ( !node)
node = xi.getChildByPath(hXml, _T("body/outline"), 0);
@@ -269,24 +268,23 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else if (!xmlUrl && outlineChildsCount)
node = xi.getFirstChild(node);
else if (xmlUrl) {
- TCHAR *text = NULL;
for (int i = 0; i < outlineAttr; i++) {
if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("text"))) {
- text = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i))));
+ TCHAR *text = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i))));
+ bool isTextUTF;
if (!text) {
- isTextUTF = 0;
+ isTextUTF = false;
text = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i));
} else
- isTextUTF = 1;
+ isTextUTF = true;
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)text);
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
- continue;
+ if (isTextUTF)
+ mir_free(text);
}
}
- if (isTextUTF)
- mir_free(text);
HXML tmpnode = node;
node = xi.getNextNode(node);
|