aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/encoding.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/encoding.cpp b/common/encoding.cpp
index 3c70f19334..46faebe313 100644
--- a/common/encoding.cpp
+++ b/common/encoding.cpp
@@ -197,6 +197,10 @@ char *Encoding::convertIconv(const char *to, const char *from, const char *strin
char *buffer = (char *) calloc(sizeof(char), stringSize);
if (!buffer) {
+#ifndef ICONV_USES_CONST
+ delete[] originalSrc;
+#endif // ICONV_USES_CONST
+ iconv_close(iconvHandle);
warning ("Cannot allocate memory for converting string");
return nullptr;
}