mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Global: fix some memleaks
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user