Fix minor memory leak on timestr;

This commit is contained in:
lwvmobile
2024-01-30 23:43:32 -05:00
parent c39ddbc7a7
commit ffa8b053d7
4 changed files with 22 additions and 6 deletions

View File

@@ -1853,7 +1853,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state)
//fix location of this statement to inside the if statement and add conditions
if (opts->audio_in_type == 3) //open rtl input if it is the specified input method
{
ncursesPrinter (opts, state); //run one rep to clear menu boxes out
// ncursesPrinter (opts, state); //not sure why this was placed here originally, but causes a double free core dump when calling free(timestr)
#ifdef USE_RTLSDR
if (opts->rtl_started == 0)
{
@@ -4353,6 +4353,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
//so probably just write a function to handle c input, and when c = certain values
//needing an entry box, then stop all of those
//allocated memory pointer needs to be free'd each time
//if issues arise, just delete this line.
//TODO: Redo this in edacs and file, making a seperate char * timestr instead of calling GetTime
//directly from the sprintf command
free (timestr);
} //end ncursesPrinter
void ncursesClose ()