Commit c660b410 authored by Brad Parker's avatar Brad Parker
Browse files

fix new/free mismatch

parent 7c3ff239
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment