]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
names-hwdb: Do now crash when hwdb.bin is not available master
authorMartin Mareš <mj@ucw.cz>
Mon, 8 Jun 2026 12:04:32 +0000 (14:04 +0200)
committerMartin Mareš <mj@ucw.cz>
Mon, 8 Jun 2026 12:04:32 +0000 (14:04 +0200)
lib/names-hwdb.c

index b1f60522b39fb63063ac270a6c677de6999849ad..e08b0c542a6bcf446421e150a994b4bd86bea374 100644 (file)
@@ -71,7 +71,11 @@ pci_id_hwdb_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int
        {
          a->debug("Initializing UDEV HWDB\n");
          a->id_udev = udev_new();
        {
          a->debug("Initializing UDEV HWDB\n");
          a->id_udev = udev_new();
+         if (!a->id_udev)
+           return NULL;
          a->id_udev_hwdb = udev_hwdb_new(a->id_udev);
          a->id_udev_hwdb = udev_hwdb_new(a->id_udev);
+         if (!a->id_udev_hwdb)
+           return NULL;
        }
 
       struct udev_list_entry *entry;
        }
 
       struct udev_list_entry *entry;