Skip to content

Commit

Permalink
Fixed crash when freeing unused pointers (#102)
Browse files Browse the repository at this point in the history
* init NULL pointers
  • Loading branch information
boris-martin authored Jul 25, 2022
1 parent ded1284 commit fed7a25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions adapter/PreciceInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tools/format-code.sh
Original file line number Diff line number Diff line change
@@ -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 {} \;

0 comments on commit fed7a25

Please sign in to comment.