From fed7a253d9c1b51b12f58a3b15ff48eb5ac11ba0 Mon Sep 17 00:00:00 2001 From: Boris Martin <84379125+boris-martin@users.noreply.github.com> Date: Mon, 25 Jul 2022 10:49:30 +0200 Subject: [PATCH] Fixed crash when freeing unused pointers (#102) * init NULL pointers --- adapter/PreciceInterface.c | 2 ++ tools/format-code.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/adapter/PreciceInterface.c b/adapter/PreciceInterface.c index 9e62cef..f5bdf2e 100644 --- a/adapter/PreciceInterface.c +++ b/adapter/PreciceInterface.c @@ -433,6 +433,8 @@ void PreciceInterface_Create(PreciceInterface *interface, SimulationData *sim, I interface->xbounIndices = NULL; interface->xloadIndices = NULL; interface->xforcIndices = NULL; + interface->writeData = NULL; + interface->readData = NULL; // Initialize data ids to -1 interface->temperatureDataID = -1; diff --git a/tools/format-code.sh b/tools/format-code.sh index f6d0379..f9582d0 100755 --- a/tools/format-code.sh +++ b/tools/format-code.sh @@ -1,4 +1,4 @@ #!/bin/sh # Format all adapter C and C++ files with clang-format -find ./ \( -iname "*.h" -o -iname "*.hpp" -o -iname "*.c" -o -iname "*.cpp" \) -exec clang-format -i {} \; +find ./ \( -iname "*.h" -o -iname "*.hpp" -o -iname "*.c" -o -iname "*.cpp" \) -exec clang-format-11 -i {} \;