TIME: Set Allocated Pointers to NULL after free()'d;

This commit is contained in:
lwvmobile
2024-04-25 18:22:28 -04:00
parent 7bcd29abec
commit db036f4dfc
10 changed files with 182 additions and 56 deletions

View File

@@ -374,7 +374,11 @@ void dmrMS (dsd_opts * opts, dsd_state * state)
state->dmr_ms_rc = 0;
state->directmode = 0; //flag off
if (timestr != NULL) free (timestr);
if (timestr != NULL)
{
free (timestr);
timestr = NULL;
}
}
@@ -618,7 +622,11 @@ void dmrMSBootstrap (dsd_opts * opts, dsd_state * state)
//errors due to skipping other slot
// cach_err = dmr_cach (opts, state, cachdata);
if (timestr != NULL) free (timestr);
if (timestr != NULL)
{
free (timestr);
timestr = NULL;
}
skipDibit (opts, state, 144); //skip to next TDMA slot
dmrMS (opts, state); //bootstrap into full TDMA frame
@@ -689,6 +697,10 @@ void dmrMSData (dsd_opts * opts, dsd_state * state)
state->dmr_stereo_payload[i+66] = 1; ////set to one so first frame will fail intentionally instead of zero fill
}
if (timestr != NULL) free (timestr);
if (timestr != NULL)
{
free (timestr);
timestr = NULL;
}
}