Skip to content
Snippets Groups Projects
Commit b65d3e57 authored by Julien Malik's avatar Julien Malik
Browse files

BUG: fix windows crash due to heap crossing with GDAL

parent e4b0f113
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ VectorDataKeywordlist ...@@ -35,7 +35,7 @@ VectorDataKeywordlist
{ {
if (m_FieldList[i].first->GetType() == OFTString) if (m_FieldList[i].first->GetType() == OFTString)
{ {
CPLFree(m_FieldList[i].second.String); VSIFree(m_FieldList[i].second.String);
} }
delete (m_FieldList[i].first); delete (m_FieldList[i].first);
} }
...@@ -64,7 +64,7 @@ VectorDataKeywordlist ...@@ -64,7 +64,7 @@ VectorDataKeywordlist
OGRFieldDefn* fieldDefn = new OGRFieldDefn(key.c_str(), OFTString); OGRFieldDefn* fieldDefn = new OGRFieldDefn(key.c_str(), OFTString);
OGRField field; OGRField field;
char * cstr = new char[value.length() + 1]; char * cstr = (char*)VSIMalloc( (value.length() + 1) * sizeof(char) );
strcpy(cstr, value.c_str()); strcpy(cstr, value.c_str());
field.String = cstr; field.String = cstr;
...@@ -132,7 +132,7 @@ VectorDataKeywordlist ...@@ -132,7 +132,7 @@ VectorDataKeywordlist
if (m_FieldList[i].first->GetType() == OFTString) if (m_FieldList[i].first->GetType() == OFTString)
{ {
OGRField field; OGRField field;
char * cstr = new char[value.length() + 1]; char * cstr = (char*)VSIMalloc( (value.length() + 1) * sizeof(char) );
strcpy(cstr, value.c_str()); strcpy(cstr, value.c_str());
field.String = cstr; field.String = cstr;
m_FieldList[i].second = field; m_FieldList[i].second = field;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment