[gnome-builder] style: always assign NULL to g_autoptr
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] style: always assign NULL to g_autoptr
- Date: Mon, 18 Dec 2017 00:58:27 +0000 (UTC)
commit 1de9bedc374d1dad54e0cbd37b0b66c1678e592d
Author: Christian Hergert <chergert redhat com>
Date: Sun Dec 17 16:57:00 2017 -0800
style: always assign NULL to g_autoptr
src/plugins/flatpak/gbp-flatpak-sources.c | 8 +++++---
src/plugins/project-tree/gb-project-tree-actions.c | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-sources.c b/src/plugins/flatpak/gbp-flatpak-sources.c
index 5233c73..1792134 100644
--- a/src/plugins/flatpak/gbp-flatpak-sources.c
+++ b/src/plugins/flatpak/gbp-flatpak-sources.c
@@ -434,14 +434,16 @@ get_soup_session (void)
}
static GBytes *
-download_uri (SoupURI *uri,
- GError **error)
+download_uri (SoupURI *uri,
+ GError **error)
{
- g_autoptr(SoupSession) session;
+ g_autoptr(SoupSession) session = NULL;
g_autoptr(SoupRequest) req = NULL;
g_autoptr(GInputStream) input = NULL;
g_autoptr(GOutputStream) out = NULL;
+ g_assert (uri != NULL);
+
session = get_soup_session ();
req = soup_session_request_uri (session, uri, error);
diff --git a/src/plugins/project-tree/gb-project-tree-actions.c
b/src/plugins/project-tree/gb-project-tree-actions.c
index f9a4945..fc2b5ea 100644
--- a/src/plugins/project-tree/gb-project-tree-actions.c
+++ b/src/plugins/project-tree/gb-project-tree-actions.c
@@ -310,7 +310,7 @@ gb_project_tree_actions_open_in_terminal (GSimpleAction *action,
if (!gb_project_file_get_is_directory (GB_PROJECT_FILE (item)))
{
- g_autoptr(GFile) parent;
+ g_autoptr(GFile) parent = NULL;
parent = g_file_get_parent (file);
workdir = g_file_get_path (parent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]