diff options
author | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> | 2014-12-17 15:01:34 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-12-18 18:37:17 +0100 |
commit | f0613a37865ac578ac75df9153ef1eac91ed424e (patch) | |
tree | 9226797527df6031f6fcd89ef4b39bb26559cddd /android/tester-gatt.c | |
parent | a738dbfa1161c3bb79bfef3252563926612c3178 (diff) | |
download | bluez-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-gatt.c')
-rw-r--r-- | android/tester-gatt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/android/tester-gatt.c b/android/tester-gatt.c index 9ba204978..f6b04924e 100644 --- a/android/tester-gatt.c +++ b/android/tester-gatt.c @@ -3394,10 +3394,14 @@ struct queue *get_gatt_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; } |