Global: fix some memleaks

This commit is contained in:
李通洲
2023-09-13 17:42:22 +08:00
parent b3bdf494ab
commit 28d40d9037
3 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ void ffPrintDateTimeFormat(struct tm* tm, const FFModuleArgs* moduleArgs)
void ffPrintDateTime(FFDateTimeOptions* options)
{
uint64_t msNow = ffTimeGetNow();
time_t sNow = msNow / 1000;
time_t sNow = (time_t) (msNow / 1000);
struct tm* tm = localtime(&sNow);
if(options->moduleArgs.outputFormat.length > 0)
+6
View File
@@ -177,4 +177,10 @@ void ffGenerateSoundJson(FF_MAYBE_UNUSED FFSoundOptions* options, yyjson_mut_doc
yyjson_mut_obj_add_strbuf(doc, obj, "name", &item->name);
yyjson_mut_obj_add_strbuf(doc, obj, "identifier", &item->identifier);
}
FF_LIST_FOR_EACH(FFSoundDevice, device, result)
{
ffStrbufDestroy(&device->identifier);
ffStrbufDestroy(&device->name);
}
}
+4
View File
@@ -119,4 +119,8 @@ void ffGenerateTerminalFontJson(FF_MAYBE_UNUSED FFTerminalOptions* options, yyjs
yyjson_mut_arr_add_strbuf(doc, fallbackStyles, style);
}
yyjson_mut_obj_add_strbuf(doc, fallback, "pretty", &result.fallback.pretty);
ffStrbufDestroy(&result.error);
ffFontDestroy(&result.font);
ffFontDestroy(&result.fallback);
}