From f29a845682070b703df54f83dc5909332c5f9df6 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sat, 19 May 2012 19:16:26 +0000 Subject: [PATCH] + realloc values before creating the string --- src/common/resourceTools.cpp | 2 +- src/common/resourceTools.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/resourceTools.cpp b/src/common/resourceTools.cpp index 5a6d2f830..05c36a433 100644 --- a/src/common/resourceTools.cpp +++ b/src/common/resourceTools.cpp @@ -4,7 +4,7 @@ std::string getResourceAsString(const std::string &name) { std::map::iterator it = resourceMap.find(name); if (it != resourceMap.end()) { - return std::string(resourceMap[name]); + return std::string(strdup(resourceMap[name])); } return ""; } diff --git a/src/common/resourceTools.h b/src/common/resourceTools.h index f0a73ab31..5c7044a11 100644 --- a/src/common/resourceTools.h +++ b/src/common/resourceTools.h @@ -2,6 +2,7 @@ #define KIWIX_RESOURCETOOLS_H #include +#include #include std::string getResourceAsString(const std::string &name); @@ -21165,8 +21166,8 @@ const unsigned char server_home_html_tmpl[]={ 0x0a,0x3c,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x0a,0x3c,0x64,0x69,0x76,0x20,0x69,0x64, 0x3d,0x22,0x61,0x63,0x63,0x6f,0x72,0x64,0x69,0x6f,0x6e,0x22,0x3e,0x0a,0x20,0x20, 0x5f,0x5f,0x42,0x4f,0x4f,0x4b,0x53,0x5f,0x5f,0x0a,0x3c,0x2f,0x64,0x69,0x76,0x3e, - 0x0a,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c, - 0x3e,0x0a + 0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e, + 0x0a }; const unsigned char server_taskbar_html_part[]={