chiark / gitweb /
Never call qsort on potentially NULL arrays
[elogind.git] / src / shared / conf-files.c
index 6d99739353be97b0553059ffb0d205acff25459d..ed4070c662711cb1e3ae7f009b336e3ad9f19b3e 100644 (file)
@@ -127,7 +127,7 @@ static int conf_files_list_strv_internal(char ***strv, const char *suffix, const
                 return -ENOMEM;
         }
 
-        qsort(files, hashmap_size(fh), sizeof(char *), base_cmp);
+        qsort_safe(files, hashmap_size(fh), sizeof(char *), base_cmp);
         *strv = files;
 
         hashmap_free(fh);