From 692d962b905f3378f457b9ccfae6fbc4d117b73b Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 26 Jan 2016 16:02:15 -0600 Subject: [PATCH] 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 --- .../VariableServer/VariableServerThread_commands.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp b/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp index 92d9da31..182b0324 100644 --- a/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp +++ b/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp @@ -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); }