mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Global: fix memleaks
This commit is contained in:
@@ -40,6 +40,9 @@ void ffPrintIcons(FFIconsOptions* options)
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result.icons2, "icons2"},
|
||||
}));
|
||||
}
|
||||
|
||||
ffStrbufDestroy(&result.icons1);
|
||||
ffStrbufDestroy(&result.icons2);
|
||||
}
|
||||
|
||||
bool ffParseIconsCommandOptions(FFIconsOptions* options, const char* key, const char* value)
|
||||
@@ -94,6 +97,9 @@ void ffGenerateIconsJsonResult(FF_MAYBE_UNUSED FFIconsOptions* options, yyjson_m
|
||||
yyjson_mut_val* icons = yyjson_mut_obj_add_obj(doc, module, "result");
|
||||
yyjson_mut_obj_add_strbuf(doc, icons, "icons1", &result.icons1);
|
||||
yyjson_mut_obj_add_strbuf(doc, icons, "icons2", &result.icons2);
|
||||
|
||||
ffStrbufDestroy(&result.icons1);
|
||||
ffStrbufDestroy(&result.icons2);
|
||||
}
|
||||
|
||||
void ffPrintIconsHelpFormat(void)
|
||||
|
||||
@@ -40,6 +40,9 @@ void ffPrintTheme(FFThemeOptions* options)
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result.theme2, "theme2"},
|
||||
}));
|
||||
}
|
||||
|
||||
ffStrbufDestroy(&result.theme1);
|
||||
ffStrbufDestroy(&result.theme2);
|
||||
}
|
||||
|
||||
bool ffParseThemeCommandOptions(FFThemeOptions* options, const char* key, const char* value)
|
||||
@@ -94,6 +97,9 @@ void ffGenerateThemeJsonResult(FF_MAYBE_UNUSED FFThemeOptions* options, yyjson_m
|
||||
yyjson_mut_val* theme = yyjson_mut_obj_add_obj(doc, module, "result");
|
||||
yyjson_mut_obj_add_strbuf(doc, theme, "theme1", &result.theme1);
|
||||
yyjson_mut_obj_add_strbuf(doc, theme, "theme2", &result.theme2);
|
||||
|
||||
ffStrbufDestroy(&result.theme1);
|
||||
ffStrbufDestroy(&result.theme2);
|
||||
}
|
||||
|
||||
void ffPrintThemeHelpFormat(void)
|
||||
|
||||
Reference in New Issue
Block a user