Do not free a static string

In file included from udevadm-hwdb.c:26:
In function ‘freep’,
    inlined from ‘adm_hwdb’ at udevadm-hwdb.c:624:38:
../../src/shared/util.h:289:9: warning: ‘free’ called on a pointer to an unallocated object ‘"/usr/etc/udev/hwdb.bin"’ [-Wfree-nonheap-object]
  289 |         free(*(void**) p);
      |         ^~~~~~~~~~~~~~~~~
../../src/shared/util.h:289:9: warning: ‘free’ called on a pointer to an unallocated object ‘"/usr/etc/udev/hwdb.bin"’ [-Wfree-nonheap-object]
This commit is contained in:
Boian Bonev 2022-09-22 00:51:17 +03:00
parent ba2cff9c54
commit e4bbbc8e36
No known key found for this signature in database
GPG Key ID: 1365720913D2F22D

View File

@ -621,7 +621,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
if (update) {
char **files, **f;
_cleanup_free_ char *hwdb_bin = UDEV_HWDB_BIN;
char *hwdb_bin = UDEV_HWDB_BIN;
trie = new0(struct trie, 1);
if (!trie) {