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

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 
This commit is contained in:
Alex Lin 2016-01-19 15:06:32 -06:00
parent e6ddb253fa
commit d1f5bea580

@ -42,10 +42,6 @@ int Trick::VariableServerThread::var_add(std::string in_name) {
} else if ( new_ref->attr ) {
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);
}