aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/common.h
diff options
context:
space:
mode:
authorDan Glastonbury <[email protected]>2017-05-19 17:11:52 +1000
committerMatthew Gregan <[email protected]>2017-05-22 13:06:17 +1200
commitad8ff2a6ef78382868658bc1fca40f4b80299bb2 (patch)
tree99dbc0c212275952a0c29f9eaaf0889db0b2668d /test/common.h
parent033b736e69bb2011594284a7e7b5638e25372b68 (diff)
downloadcubeb-ad8ff2a6ef78382868658bc1fca40f4b80299bb2.tar.gz
cubeb-ad8ff2a6ef78382868658bc1fca40f4b80299bb2.zip
Fix memory leaks in tests.
Diffstat (limited to 'test/common.h')
-rw-r--r--test/common.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/common.h b/test/common.h
index ef53963..35368fa 100644
--- a/test/common.h
+++ b/test/common.h
@@ -82,6 +82,7 @@ int has_available_input_device(cubeb * ctx)
if (devices->count == 0) {
fprintf(stderr, "no input device available, skipping test.\n");
+ cubeb_device_collection_destroy(devices);
return 0;
}
@@ -93,10 +94,10 @@ int has_available_input_device(cubeb * ctx)
if (!input_device_available) {
fprintf(stderr, "there are input devices, but they are not "
"available, skipping\n");
- return 0;
}
- return 1;
+ cubeb_device_collection_destroy(devices);
+ return !!input_device_available;
}
void print_log(const char * msg, ...)