From e9c962b4c064003a43b65b1085d8b8052fe57617 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 28 Sep 2015 18:20:42 +0200 Subject: [PATCH] Fix bug => do not free Variables memory twice!! (this case can be occured with a remoted VirtualInstrument) --- src/SERVER/DD_GetData.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SERVER/DD_GetData.c b/src/SERVER/DD_GetData.c index 9d7643c..db388a9 100755 --- a/src/SERVER/DD_GetData.c +++ b/src/SERVER/DD_GetData.c @@ -588,9 +588,12 @@ int GetAttribute(int ID, char *VarName) DD_Var[ID]->VarData[il].VarNumber = 0; } //BRE - 17/09/15 - Free variables !! - if((DD_Var[ID]->LastPacketFlag == OK) || DD_Var[ID]->NewFile) // Request been finished or - // System was trying to open new file + if(((DD_Var[ID]->LastPacketFlag == OK) || DD_Var[ID]->NewFile) && (DD_Var[ID]->VarData[il].Variables != NULL)) // Request been finished or + // System was trying to open new file + { free(DD_Var[ID]->VarData[il].Variables); + DD_Var[ID]->VarData[il].Variables = NULL; + } } /*============================================================================ -- libgit2 0.21.2