Fix "Use of memory after it is freed" errors identified by clang-tidy
pathl = path_from_utf8(path);
f = fopen(pathl, "r");
- g_free(pathl);
if (!f)
{
log_printf("Warning: keywords file %s not loaded", pathl);
+ g_free(pathl);
return;
}
{
fclose(f);
log_printf("Warning: keywords file %s not loaded", pathl);
+ g_free(pathl);
return;
}
+ g_free(pathl);
+
while (fgets(s_buf, sizeof(s_buf), f))
{
if (s_buf[0]=='#') continue;
if (haystack && strcmp(haystack, path) == 0)
{
- g_free(haystack);
options->disabled_plugins = g_list_remove(options->disabled_plugins, haystack);
+ g_free(haystack);
}
list = list->next;
if (nd->func == func && nd->data == data)
{
notify_func_list = g_list_delete_link(notify_func_list, work);
- g_free(nd);
DEBUG_2("Notify func unregistered: %p", (void *)nd);
+ g_free(nd);
return TRUE;
}
work = work->next;