Merge branch 'mcatanzaro/coverity' into 'master'

Fix a handful of minor leaks found by Coverity

See merge request GNOME/glib!2027
This commit is contained in:
Philip Withnall 2021-04-05 16:44:35 +00:00
commit 1059b7eae1
5 changed files with 14 additions and 5 deletions

View File

@ -30,6 +30,7 @@ main (int argc, char **argv)
LLVMFuzzerTestOneInput (buf, len);
free (buf);
fclose (f);
printf ("Done!\n");
return 0;
}

View File

@ -2524,7 +2524,12 @@ g_application_run (GApplication *application,
context = g_main_context_default ();
acquired_context = g_main_context_acquire (context);
g_return_val_if_fail (acquired_context, 0);
if (!acquired_context)
{
g_critical ("g_application_run() cannot acquire the default main context because it is already acquired by another thread!");
g_strfreev (arguments);
return 1;
}
if (!G_APPLICATION_GET_CLASS (application)
->local_command_line (application, &arguments, &status))

View File

@ -1007,6 +1007,7 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
g_propagate_error (error, local_error);
goto out;
}
g_clear_error (&local_error);
}
else
{

View File

@ -565,12 +565,12 @@ void
g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager,
GDBusObjectSkeleton *object)
{
gchar *orig_object_path;
const gchar *orig_object_path;
gchar *object_path;
guint count;
gboolean modified;
orig_object_path = g_strdup (g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
orig_object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (object));
g_return_if_fail (G_IS_DBUS_OBJECT_MANAGER_SERVER (manager));
g_return_if_fail (G_IS_DBUS_OBJECT (object));
@ -602,7 +602,6 @@ g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager,
g_dbus_object_skeleton_set_object_path (G_DBUS_OBJECT_SKELETON (object), object_path);
g_free (object_path);
g_free (orig_object_path);
}

View File

@ -787,7 +787,10 @@ next_files_thread (GTask *task,
}
if (error)
g_task_return_error (task, error);
{
g_list_free_full (files, g_object_unref);
g_task_return_error (task, error);
}
else
g_task_return_pointer (task, files, (GDestroyNotify)next_async_op_free);
}