Skip to content

Commit

Permalink
Do not free a static string
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
bbonev committed Sep 21, 2022
1 parent ba2cff9 commit e4bbbc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/udev/udevadm-hwdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e4bbbc8

Please sign in to comment.