summaryrefslogtreecommitdiff
path: root/libs/hunspell/src/filemgr.c++
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hunspell/src/filemgr.c++')
-rw-r--r--libs/hunspell/src/filemgr.c++10
1 files changed, 3 insertions, 7 deletions
diff --git a/libs/hunspell/src/filemgr.c++ b/libs/hunspell/src/filemgr.c++
index cbe41c577b..2218bc79e1 100644
--- a/libs/hunspell/src/filemgr.c++
+++ b/libs/hunspell/src/filemgr.c++
@@ -89,13 +89,9 @@ FileMgr::FileMgr(const char* file, const char* key) : hin(NULL), linenum(0) {
fin = myfopen(file, "r");
if (!fin) {
// check hzipped file
- char* st = (char*)malloc(strlen(file) + strlen(HZIP_EXTENSION) + 1);
- if (st) {
- strcpy(st, file);
- strcat(st, HZIP_EXTENSION);
- hin = new Hunzip(st, key);
- free(st);
- }
+ std::string st(file);
+ st.append(HZIP_EXTENSION);
+ hin = new Hunzip(st.c_str(), key);
}
if (!fin && !hin)
fail(MSG_OPEN, file);