Fixed memory leak

This commit is contained in:
Robert Osfield
2007-12-13 14:26:03 +00:00
parent 1fbb0a8674
commit 0dc71306e7

View File

@@ -160,7 +160,8 @@ bool XBaseParser::parse(int fd)
char* str = new char[it->_fieldLength + 1];
memcpy(str, recordPtr, it->_fieldLength);
str[it->_fieldLength] = 0;
shapeAttributeList->push_back(osgSim::ShapeAttribute((const char *) it->_name, (char*) str));
shapeAttributeList->push_back(osgSim::ShapeAttribute((const char *) it->_name, (char*) str));
delete [] str;
break;
}
case 'N':
@@ -169,6 +170,7 @@ bool XBaseParser::parse(int fd)
memcpy(number, recordPtr, it->_fieldLength);
number[it->_fieldLength] = 0;
shapeAttributeList->push_back(osgSim::ShapeAttribute((const char *) it->_name, (int) atoi(number)));
delete [] number;
break;
}
case 'I':