chiark / gitweb /
Never call qsort on potentially NULL arrays
[elogind.git] / src / journal / catalog.c
index 7738d243a58f3eaa575a10a2083d32c96f40385c..90ca00806448b3282df1f6bddf63554524255fc6 100644 (file)
@@ -399,7 +399,7 @@ int catalog_update(const char* database, const char* root, const char* const* di
         }
 
         assert(n == hashmap_size(h));
-        qsort(items, n, sizeof(CatalogItem), catalog_compare_func);
+        qsort_safe(items, n, sizeof(CatalogItem), catalog_compare_func);
 
         r = write_catalog(database, h, sb, items, n);
         if (r < 0)