From 5075166d63aaa9d8c6f441d6073a72b24431408b Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 22 Jan 2014 14:29:05 +0100 Subject: [PATCH 1/3] Properly initialize all used variables --- src/udiskslinuxblock.c | 8 ++++---- src/udiskslinuxdriveata.c | 2 +- src/udiskslinuxfilesystem.c | 2 +- src/udisksstate.c | 2 +- tools/udisksctl.c | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c index 22bcfd0..c72dded 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c @@ -1521,7 +1521,7 @@ handle_add_configuration_item (UDisksBlock *_block, UDisksLinuxBlockObject *object; UDisksDaemon *daemon; const gchar *type; - GVariant *details; + GVariant *details = NULL; GError *error; error = NULL; @@ -1598,7 +1598,7 @@ handle_remove_configuration_item (UDisksBlock *_block, UDisksLinuxBlockObject *object; UDisksDaemon *daemon; const gchar *type; - GVariant *details; + GVariant *details = NULL; GError *error; error = NULL; @@ -1677,8 +1677,8 @@ handle_update_configuration_item (UDisksBlock *_block, UDisksDaemon *daemon; const gchar *old_type; const gchar *new_type; - GVariant *old_details; - GVariant *new_details; + GVariant *old_details = NULL; + GVariant *new_details = NULL; GError *error; error = NULL; diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c index 534ef4d..5c36078 100644 --- a/src/udiskslinuxdriveata.c +++ b/src/udiskslinuxdriveata.c @@ -637,7 +637,7 @@ udisks_linux_drive_ata_smart_selftest_sync (UDisksLinuxDriveAta *drive, GError **error) { UDisksLinuxDriveObject *object; - UDisksLinuxDevice *device; + UDisksLinuxDevice *device = NULL; SkDisk *d = NULL; gboolean ret = FALSE; SkSmartSelfTest test; diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c index f243046..4503b51 100644 --- a/src/udiskslinuxfilesystem.c +++ b/src/udiskslinuxfilesystem.c @@ -1558,7 +1558,7 @@ handle_unmount (UDisksFilesystem *filesystem, GError *error; uid_t mounted_by_uid; uid_t caller_uid; - gint status; + gint status = 0; gchar *error_message; const gchar *const *mount_points; gboolean opt_force; diff --git a/src/udisksstate.c b/src/udisksstate.c index e7b549a..4dfe393 100644 --- a/src/udisksstate.c +++ b/src/udisksstate.c @@ -530,7 +530,7 @@ udisks_state_check_mounted_fs_entry (UDisksState *state, const gchar *mount_point; GVariant *details; GVariant *block_device_value; - dev_t block_device; + dev_t block_device = 0; GVariant *fstab_mount_value; gboolean fstab_mount; gboolean keep; diff --git a/tools/udisksctl.c b/tools/udisksctl.c index 209c0a3..bb1182c 100644 --- a/tools/udisksctl.c +++ b/tools/udisksctl.c @@ -890,6 +890,7 @@ read_passphrase (void) gchar *ret; ret = NULL; + str = NULL; tty_name = ctermid (NULL); if (tty_name == NULL) -- 1.8.1.5