AP_Scipting: fix memleak on generator

This commit is contained in:
Pierre Kancir 2020-08-21 18:33:35 +02:00 committed by Andrew Tridgell
parent caf5bfed59
commit af1bdcfdfc
1 changed files with 4 additions and 1 deletions

View File

@ -171,6 +171,8 @@ void trace(const int trace, const char *message, ...) {
va_start(args, message); va_start(args, message);
vfprintf(stderr, fmt, args); vfprintf(stderr, fmt, args);
va_end(args); va_end(args);
free(fmt);
fmt = NULL;
} }
} }
@ -191,7 +193,8 @@ void error(const int code, const char *message, ...) {
va_start(args, message); va_start(args, message);
vfprintf(stderr, fmt, args); vfprintf(stderr, fmt, args);
va_end(args); va_end(args);
free(fmt);
fmt = NULL;
exit(code); exit(code);
} }