fix memory leak in GFX_printf

This commit is contained in:
Shuanglei Tao
2025-04-26 20:16:09 +08:00
parent 436f5eb2f0
commit 6d1bbcf3e3

View File

@@ -936,5 +936,9 @@ size_t GFX_printf(Adafruit_GFX *gfx, const char* format, ...) {
va_end(va);
}
return GFX_write(gfx, buf, len);
len = GFX_write(gfx, buf, len);
if (buf != tmp)
free(buf);
return len;
}