From 2b16e35b59294f62e9486a77d16477498a0dc78e Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 24 Jan 2015 20:59:02 +0000 Subject: NewsAggregator: -Fixed another memory leak git-svn-id: http://svn.miranda-ng.org/main/trunk@11902 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/ExportImport.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins') 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); -- cgit v1.2.3