Clear GError in cleanup section

This commit is contained in:
Pavel Grunt 2015-03-20 10:35:55 +01:00 committed by Fabiano Fidêncio
parent 1bcd8d0fe6
commit 526e882368
2 changed files with 2 additions and 4 deletions

View File

@ -134,7 +134,6 @@ main(int argc, char **argv)
g_printerr(_("%s\nRun '%s --help' to see a full list of available command line options\n"),
error->message, base_name);
g_free(base_name);
g_error_free(error);
goto cleanup;
}
@ -177,7 +176,6 @@ main(int argc, char **argv)
if (!virt_viewer_app_start(app, &error)) {
if (g_error_matches(error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED))
ret = 0;
g_clear_error(&error);
goto cleanup;
}
@ -193,6 +191,7 @@ main(int argc, char **argv)
if (viewer)
g_object_unref(viewer);
g_strfreev(args);
g_clear_error(&error);
return ret;
}

View File

@ -98,7 +98,6 @@ int main(int argc, char **argv)
if (error) {
g_printerr("%s\n%s\n",
error->message, help_msg);
g_error_free(error);
goto cleanup;
}
@ -116,7 +115,6 @@ int main(int argc, char **argv)
if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer), &error)) {
if (g_error_matches(error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED))
ret = 0;
g_clear_error(&error);
goto cleanup;
}
@ -130,6 +128,7 @@ int main(int argc, char **argv)
g_free(uri);
g_strfreev(args);
g_free(help_msg);
g_clear_error(&error);
return ret;
}