Sending the variable server a variable name that lists a composite type causes core dump

Duplicating change from 15.1.1.
If a variable resolves to a class/structure type the variable server tries to free the
attributes associated with that variable name.  But the attributes usually point to
a fixed place in memory that is not allocated.  I removed the free statement.  I don't
believe this will lead to a memory leak.

refs #165
This commit is contained in:
Alex Lin 2016-01-26 16:02:15 -06:00
parent bc9ef8c54b
commit 692d962b90

View File

@ -60,9 +60,6 @@ int Trick::VariableServerThread::var_add(std::string in_name) {
if ( new_ref->attr->type == TRICK_STRUCTURED ) {
message_publish(MSG_ERROR, "Variable Server: var_add cant add \"%s\" because its a composite variable.\n", in_name.c_str());
// Replace the REF2 object we got from ref_attributes with an error-ref.
if (new_ref->attr) {
free(new_ref->attr);
}
free(new_ref);
new_ref = make_error_ref(in_name);
}