Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2013-09-07 17:02:45 +0400
committerUnderground78 <underground78@users.sourceforge.net>2013-09-08 00:37:53 +0400
commita08ece5ce4c5b8ea701ed136f90437eda0b3fb23 (patch)
tree5b0844a974fab97119ee92c29fa5709c01666640 /src
parent8046ecccd73579c808361bfd37b292a1df5e2835 (diff)
IsISO639Language: Fix a memory leak detected by Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/DSUtil/DSUtil.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp
index c3271127d..9d980ae38 100644
--- a/src/DSUtil/DSUtil.cpp
+++ b/src/DSUtil/DSUtil.cpp
@@ -2021,12 +2021,17 @@ bool IsISO639Language(LPCSTR code)
_strlwr_s(tmp, nLen);
tmp[0] = toupper(tmp[0]);
+ bool bFound = false;
for (size_t i = 0, cnt = _countof(s_isolangs); i < cnt; i++) {
if (!strcmp(s_isolangs[i].name, tmp)) {
- return true;
+ bFound = true;
+ break;
}
}
- return false;
+
+ delete [] tmp;
+
+ return bFound;
}
CString ISO639XToLanguage(LPCSTR code, bool bCheckForFullLangName /*= false*/)