summaryrefslogtreecommitdiff
path: root/android/tester-pan.c
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2014-12-17 15:01:34 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-12-18 18:37:17 +0100
commitf0613a37865ac578ac75df9153ef1eac91ed424e (patch)
tree9226797527df6031f6fcd89ef4b39bb26559cddd /android/tester-pan.c
parenta738dbfa1161c3bb79bfef3252563926612c3178 (diff)
downloadbluez-f0613a37865ac578ac75df9153ef1eac91ed424e.tar.gz
android/tester: Add verification for test case list creators
To be safe it must be chcecked if queue_new and add test case to list was successful.
Diffstat (limited to 'android/tester-pan.c')
-rw-r--r--android/tester-pan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/android/tester-pan.c b/android/tester-pan.c
index 4feb6cfa2..e033e215d 100644
--- a/android/tester-pan.c
+++ b/android/tester-pan.c
@@ -226,10 +226,14 @@ struct queue *get_pan_tests(void)
uint16_t i = 0;
list = queue_new();
+ if (!list)
+ return NULL;
for (; i < sizeof(test_cases) / sizeof(test_cases[0]); ++i)
- if (!queue_push_tail(list, &test_cases[i]))
+ if (!queue_push_tail(list, &test_cases[i])) {
+ queue_destroy(list, NULL);
return NULL;
+ }
return list;
}