chiark / gitweb /
Never call qsort on potentially NULL arrays
[elogind.git] / src / shared / efivars.c
index c015b168579ebb25c8eace507c775b572d79a317..f3eb6a6e5d1ca321555820a4141f2a0b7291f377 100644 (file)
@@ -384,8 +384,7 @@ int efi_get_boot_options(uint16_t **options) {
                 list[count ++] = id;
         }
 
-        if (list)
-                qsort(list, count, sizeof(uint16_t), cmp_uint16);
+        qsort_safe(list, count, sizeof(uint16_t), cmp_uint16);
 
         *options = list;
         return count;