eudev-project / eudev

Repository for eudev development
GNU General Public License v2.0
521 stars 145 forks source link

Do not free a static string #238

Closed bbonev closed 1 year ago

bbonev commented 1 year ago

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]

ArsenArsen commented 1 year ago

There's a bit more work to consider, the string is reassigned later down the function.

bbonev commented 1 year ago

Thanks! Looks like I missed that...

bbonev commented 1 year ago

Please check it again with the last commits...