]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-device: fix double-free
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 12 Dec 2022 05:16:09 +0000 (14:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 12 Dec 2022 05:20:47 +0000 (14:20 +0900)
commiteb18e7b7825e8320bb4d6269690ef8c3f5461d2b
tree624ccaed9d00ade1e7de3ffde0bd2e6a3b62e85f
parent4113a3e0f379a84c43a7b6b121e00022e9836bb7
sd-device: fix double-free

If an attribute is read but the value is not used (i.e. ret_value is NULL),
then sd_device_get_sysattr_value() mistakenly frees the read data even though
it is cached internally.

Fixes a bug introduced by acfc2a1d15560084e077ffb3be472cd117e9020a.

Fixes #25702.
src/libsystemd/sd-device/sd-device.c