Skip to content

Commit

Permalink
Switched sanitizer to run on macOS-13. This means it does NOT check f…
Browse files Browse the repository at this point in the history
…or memory leaks, only buffer overflows (which is OK).

Added a few frees that I missed.
  • Loading branch information
Rory Barnes committed Sep 4, 2024
1 parent 0f9f5fb commit 324d399
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

jobs:
sanitizer:
name: Run address-sanitizer on Ubuntu
runs-on: ubuntu-latest
name: Run address-sanitizer on macOS
runs-on: macos-13
strategy:
fail-fast: false

Expand Down
6 changes: 2 additions & 4 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,6 +2041,8 @@ void LogOutputOrder(BODY *body, CONTROL *control, FILES *files, OUTPUT *output,
}
fprintf(fp, "\n");
free(cCol);
free(cUnit);
free(cTmp);
}

void LogGridOutput(BODY *body, CONTROL *control, FILES *files, OUTPUT *output,
Expand Down Expand Up @@ -2174,7 +2176,6 @@ void LogBody(BODY *body, CONTROL *control, FILES *files, MODULE *module,
void WriteLog(BODY *body, CONTROL *control, FILES *files, MODULE *module,
OPTIONS *options, OUTPUT *output, SYSTEM *system, UPDATE *update,
fnUpdateVariable ***fnUpdate, fnWriteOutput fnWrite[], int iEnd) {
char *cTime=NULL;
FILE *fp;
double dTotTime;

Expand All @@ -2186,13 +2187,10 @@ void WriteLog(BODY *body, CONTROL *control, FILES *files, MODULE *module,
double dDt = fdGetTimeStep(body, control, system, update, fnUpdate);

if (iEnd == 0) {
fvFormattedString(&cTime, "Input");
fp = fopen(files->cLog, "w");
} else if (iEnd == 1) {
fvFormattedString(&cTime, "Final");
fp = fopen(files->cLog, "a");
} else if (iEnd == -1) {
fvFormattedString(&cTime, "Initial");
fp = fopen(files->cLog, "w");
} else {
fprintf(stderr, "ERROR: Unknown cTime in output.c:WriteLog.\n");
Expand Down

0 comments on commit 324d399

Please sign in to comment.