if (!key_list) {
_E("Failed to read the group %s (%s). Foreach function will not launched",
group, err ? err->message : NULL);
+ g_clear_error(&err);
return;
}
for (i = 0; i < len; i++) {
- value = g_key_file_get_value(config_file, group, key_list[i], &err);
+ value = g_key_file_get_value(config_file, group, key_list[i], NULL);
if (!value) {
_E("Failed to find the value paired with %s. Skip it", key_list[i]);
continue;
if (!g_key_file_load_from_file(config_file, path, G_KEY_FILE_NONE, &err)) {
_E("Failed to load %s : %s", path, err ? err->message : NULL);
+ g_key_file_free(config_file);
+ g_clear_error(&err);
return -EIO;
}
g_dbus_node_info_unref(method_handle->node_info);
free(method_handle);
}
+ g_slist_free(dbus_method_handle_list);
/* Remove D-Bus signal list */
G_SLIST_FOREACH_WITH_REMOVE(dbus_signal_handle_list, signal_handle) {
free(signal_handle->path);
free(signal_handle);
}
+ g_slist_free(dbus_signal_handle_list);
g_object_unref(conn);
}
G_SLIST_FOREACH_WITH_REMOVE(library_list, library)
dlclose(library);
+
+ g_slist_free(library_list);
}
int main(int argc, char **argv)
continue;
}
- if (strncmp(label, "User::Pkg::", 11))
+ if (strncmp(label, "User::Pkg::", 11)) {
+ g_free(candidate);
continue;
+ }
}
ret = procfs_get_pid_basename(pid, NAME_MAX, candidate->basename);
break;
}
}
- g_slist_free_full(candidates, g_free);
+ g_slist_free(candidates);
candidates = NULL;
if (range == MEMORY_KILLER_RANGE_ONLY_APP && need_to_retain > 0) {
g_assert(appusage);
g_variant_builder_add_value(&builder, appusage);
}
+ g_slist_free(applist);
return g_variant_new("(a(su))", &builder);
}
g_variant_builder_add_value(&builder, appusage);
}
+ g_slist_free(applist);
return g_variant_new("(a(su))", &builder);
}