summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-10-06 15:46:22 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-10-06 15:46:22 -0400
commitc83ade0d8bcac48f843abefa5a7a6a8cc093ec86 (patch)
tree731ca3b4432ca68955cedb8367f5f19f00b9b56f
parent4b35ffe5ae286f6062bd9cc31493d33625bff6d4 (diff)
Handle error paths correctly
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--stc/stcitem.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/stc/stcitem.c b/stc/stcitem.c
index 1d2d2b7..fc9a96c 100644
--- a/stc/stcitem.c
+++ b/stc/stcitem.c
@@ -1646,10 +1646,14 @@ _stc_item_start_filesystem (StcItem *item,
g_free (q_device);
g_free (q_options);
- ret = run_command_line_sync_simple (command_line,
- NULL,
- cancellable,
- error);
+ if (!run_command_line_sync_simple (command_line,
+ NULL,
+ cancellable,
+ error))
+ {
+ g_free (command_line);
+ goto out;
+ }
g_free (command_line);
}
else
@@ -2038,10 +2042,14 @@ _stc_item_stop_filesystem (StcItem *item,
command_line = g_strdup_printf ("umount %s", q_mount_path);
g_free (q_mount_path);
- ret = run_command_line_sync_simple (command_line,
- NULL,
- cancellable,
- error);
+ if (!run_command_line_sync_simple (command_line,
+ NULL,
+ cancellable,
+ error))
+ {
+ g_free (command_line);
+ goto out;
+ }
g_free (command_line);
}
else