memory leaks
LowLevelMahn opened this issue · 2 comments
LowLevelMahn commented
in utility_loadFile
if (fread(dst, 1, len, file) < len) {
//debug_log(DEBUG_ERROR, "[ERROR] utility_loadFile: %s input was less than %lu bytes\r\n", srcfile, (uint32_t)len);
free(dst);
<-- fclose(file);
return -1;
}
in debug_log
void debug_log(uint8_t level, char* format, ...) {
va_list argptr;
va_start(argptr, format);
if (level > debug_level) {
<-- va_end(argptr);
return; }
...
in blaster_writecmd
blaster->dorecord = (blaster->lastcmd == 0x24) ? 1 : 0;
is always true
mikechambers84 commented
Thanks, good catches! I'll fix these up in the next commit. Missing va_end especially would have been an issue over a long period of time, as debug_log can be called a lot depending on the options in config.h
mikechambers84 commented
I pushed the memory leak fixes. I'll look at what I'm doing in blaster_writecmd later tonight.