From a60b1b56fbc24b1ca60d11f27896a47c1f7ba3b1 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 4 May 2016 11:32:27 +0200 Subject: benchmark: fix unref if camera was not instantiated --- bin/tools/benchmark.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/tools/benchmark.c b/bin/tools/benchmark.c index b3a873f..f4c6c52 100644 --- a/bin/tools/benchmark.c +++ b/bin/tools/benchmark.c @@ -361,7 +361,7 @@ main (int argc, char *argv[]) if (!uca_camera_parse_arg_props (camera, argv, argc - 1, &error)) { g_print ("Error setting properties: %s\n", error->message); - goto cleanup_manager; + goto cleanup_camera; } benchmark (camera, &options); @@ -369,9 +369,11 @@ main (int argc, char *argv[]) g_io_channel_shutdown (log_channel, TRUE, &error); g_assert_no_error (error); +cleanup_camera: + g_object_unref (camera); + cleanup_manager: g_object_unref (manager); - g_object_unref (camera); return 0; } -- cgit v1.2.3