summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/xslRowsCache.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/project2/xslRowsCache.cpp b/project2/xslRowsCache.cpp
index 7f6c8ec..5cbc44c 100644
--- a/project2/xslRowsCache.cpp
+++ b/project2/xslRowsCache.cpp
@@ -1,4 +1,5 @@
#include "xslRowsCache.h"
+#include <string.h>
#include <libxml/HTMLparser.h>
#include "exceptions.h"
@@ -16,11 +17,15 @@ class XslCachePopulator : public CurlCompleteCallback {
url(u),
html(h),
warnings(w),
- encoding(e)
+ encoding(e ? strdup(e) : NULL)
{
curl->setopt(CURLOPT_WRITEDATA, &buf);
curl->setopt(CURLOPT_WRITEFUNCTION, &XslRowsCache::handleDataHelper);
}
+ ~XslCachePopulator()
+ {
+ free(encoding);
+ }
void call(CurlBulkFetcher *)
{
int flags = 0;
@@ -39,7 +44,7 @@ class XslCachePopulator : public CurlCompleteCallback {
const Glib::ustring url;
const bool html;
const bool warnings;
- const char * encoding;
+ char * encoding;
};
size_t