summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:37:03 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:37:03 +0000
commitc66ffdf720b1c1c8ce854d3adcca4e40033655c1 (patch)
treefe858d28e2e7ca79315c4422e2536f7c815b70a7 /src/pugixml.cpp
parent123050298918cc3e582c29c67f291d65c33e40ea (diff)
XPath: Several variable fixes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@678 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 366618a..c7e7fd6 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -5346,6 +5346,11 @@ namespace
struct xpath_variable_string: xpath_variable
{
+ ~xpath_variable_string()
+ {
+ if (value) global_deallocate(value);
+ }
+
char_t* value;
char_t name[1];
};
@@ -5381,7 +5386,7 @@ namespace
{
size_t length = strlength(name);
- // we can't use offsetof(T, name) because T is non-POD, so we just allocate additional length characters
+ // $$ we can't use offsetof(T, name) because T is non-POD, so we just allocate additional length characters
void* memory = global_allocate(sizeof(T) + length * sizeof(char_t));
if (!memory) return 0;
@@ -5409,7 +5414,6 @@ namespace
return new_xpath_variable<xpath_variable_boolean>(name);
default:
- assert(false);
return 0;
}
}