From c4c54b37ce2430d264184a2b0d46a1e7230ed3fc Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Sat, 14 Sep 2024 08:49:43 +0000 Subject: [PATCH] Added NULL pointer (#3998) This ports https://github.com/lbl-srg/modelica-buildings/pull/3995 --- Buildings/Resources/C-Sources/cfdSendStopCommand.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Buildings/Resources/C-Sources/cfdSendStopCommand.c b/Buildings/Resources/C-Sources/cfdSendStopCommand.c index 93cf78653b1..9e973ea0bab 100644 --- a/Buildings/Resources/C-Sources/cfdSendStopCommand.c +++ b/Buildings/Resources/C-Sources/cfdSendStopCommand.c @@ -149,6 +149,9 @@ void cfdSendStopCommand(void *thread) { } if (cosim != NULL){ free(cosim); + /* If it is not explicitly set to NULL - then the check in cfdcosim() + will fail if a second simulation is performed. */ + cosim = NULL; } } /* End of cfdSendStopCommand*/