Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in mgos_homeassistant_barometer.c #1

Closed
nliviu opened this issue Dec 11, 2020 · 0 comments
Closed

Memory leak in mgos_homeassistant_barometer.c #1

nliviu opened this issue Dec 11, 2020 · 0 comments

Comments

@nliviu
Copy link

nliviu commented Dec 11, 2020

Log:

mgos_homeassistant_:104 Could not create barometer of type bme280 at i2caddr -1

...
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x4da338 in calloc (/home/liviu/mos/homeassistant-demo/build/objs/homeassistant-demo.elf+0x4da338)
    #1 0x5599ac in mgos_homeassistant_barometer_fromjson /home/liviu/.mos/deps/homeassistant/src/mgos_homeassistant_barometer.c:101:13

QRPp added a commit to QRPp/homeassistant that referenced this issue Sep 4, 2021
When bailing out between allocation of struct mgos_homeassistant_barometer and
creation of a struct mgos_homeassistant_object, the former wasn't free()d.

(*) Also drop a repeated pointer check in barometer_pre_remove_cb().
QRPp added a commit that referenced this issue Sep 4, 2021
Fix mgos_homeassistant_barometer_fromjson() leak (#1)
@QRPp QRPp closed this as completed Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants