fix new/free mismatch

This commit is contained in:
Brad Parker 2019-07-30 16:26:06 -04:00
parent 7c3ff239c5
commit c660b41050

View File

@ -295,7 +295,7 @@ void MDFN_printf(const char *format, ...)
format_temp[newlen] = 0;
temp = new char[4096];
temp = (char*)malloc(4096 * sizeof(char));
vsnprintf(temp, 4096, format_temp, ap);
free(format_temp);
@ -313,7 +313,7 @@ void MDFN_PrintError(const char *format, ...)
va_start(ap, format);
temp = new char[4096];
temp = (char*)malloc(4096 * sizeof(char));
vsnprintf(temp, 4096, format, ap);
MDFND_PrintError(temp);
free(temp);
@ -329,7 +329,7 @@ void MDFN_DebugPrintReal(const char *file, const int line, const char *format, .
va_start(ap, format);
temp = new char[4096];
temp = (char*)malloc(4096 * sizeof(char));
vsnprintf(temp, 4096, format, ap);
fprintf(stderr, "%s:%d %s\n", file, line, temp);
free(temp);
@ -1487,7 +1487,7 @@ void MDFN_DispMessage(const char *format, ...)
struct retro_message msg;
va_list ap;
va_start(ap,format);
char *str = new char[4096];
char *str = (char*)malloc(4096 * sizeof(char));
const char *strc = NULL;
vsnprintf(str, 4096, format,ap);