summaryrefslogtreecommitdiff
path: root/daemon/gdm-x-session.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2015-02-20 10:20:34 -0500
committerRay Strode <rstrode@redhat.com>2015-02-20 10:30:53 -0500
commitc486068f1b32d6ba57c97f044a7c8e4a556ab8bf (patch)
treebb58d5363808c10c6ec92b2960577c70f12c6bf1 /daemon/gdm-x-session.c
parent7981fe45dd93405d63f4147098c7a2820b4297d0 (diff)
downloadgdm-c486068f1b32d6ba57c97f044a7c8e4a556ab8bf.tar.gz
gdm-x-session: initialize local pointers to NULL
We follow the "goto out" idiom for error handling, and so it's important that pointers cleaned up at out time, are initialized. This commit does a sweep and nullifies them across the board. https://bugzilla.gnome.org/show_bug.cgi?id=744787
Diffstat (limited to 'daemon/gdm-x-session.c')
-rw-r--r--daemon/gdm-x-session.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
index e97cfff5..b6bfe832 100644
--- a/daemon/gdm-x-session.c
+++ b/daemon/gdm-x-session.c
@@ -195,11 +195,11 @@ spawn_x_server (State *state,
gboolean allow_remote_connections,
GCancellable *cancellable)
{
- GPtrArray *arguments;
- GSubprocessLauncher *launcher;
- GSubprocess *subprocess;
- GInputStream *input_stream;
- GDataInputStream *data_stream;
+ GPtrArray *arguments = NULL;
+ GSubprocessLauncher *launcher = NULL;
+ GSubprocess *subprocess = NULL;
+ GInputStream *input_stream = NULL;
+ GDataInputStream *data_stream = NULL;
GError *error = NULL;
char *auth_file;
@@ -363,14 +363,14 @@ static gboolean
spawn_bus (State *state,
GCancellable *cancellable)
{
- GPtrArray *arguments;
- GSubprocessLauncher *launcher;
- GSubprocess *subprocess;
- GInputStream *input_stream;
- GDataInputStream *data_stream;
+ GPtrArray *arguments = NULL;
+ GSubprocessLauncher *launcher = NULL;
+ GSubprocess *subprocess = NULL;
+ GInputStream *input_stream = NULL;
+ GDataInputStream *data_stream = NULL;
GError *error = NULL;
char *bus_address_fd_string;
- char *bus_address;
+ char *bus_address = NULL;
gsize bus_address_size;
gboolean is_running = FALSE;
@@ -489,8 +489,8 @@ spawn_session (State *state,
gboolean run_script,
GCancellable *cancellable)
{
- GSubprocessLauncher *launcher;
- GSubprocess *subprocess;
+ GSubprocessLauncher *launcher = NULL;
+ GSubprocess *subprocess = NULL;
GError *error = NULL;
gboolean is_running = FALSE;
const char *vt;
@@ -588,7 +588,7 @@ static gboolean
register_display (State *state,
GCancellable *cancellable)
{
- GdmDBusManager *manager;
+ GdmDBusManager *manager = NULL;
GError *error = NULL;
gboolean registered = FALSE;
GVariantBuilder details;
@@ -663,8 +663,8 @@ int
main (int argc,
char **argv)
{
- State *state;
- GOptionContext *context;
+ State *state = NULL;
+ GOptionContext *context = NULL;
static char **args = NULL;
static gboolean run_script = FALSE;
static gboolean allow_remote_connections = FALSE;