Skip to content

Memory leak in retrieve_sensors() #105

@dgraziotin

Description

@dgraziotin

As reported by valgrind

==30820== 
==30820== HEAP SUMMARY:
==30820==     in use at exit: 51 bytes in 1 blocks
==30820==   total heap usage: 305 allocs, 304 frees, 525,754 bytes allocated
==30820== 
==30820== 51 bytes in 1 blocks are definitely lost in loss record 1 of 1
==30820==    at 0x4C2CB3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30820==    by 0x10B17C: retrieve_sensors (mbpfan.c:150)
==30820==    by 0x10BD47: mbpfan (mbpfan.c:513)
==30820==    by 0x10ADEC: go_daemon (daemon.c:225)
==30820==    by 0x10C478: main (main.c:148)
==30820== 
==30820== LEAK SUMMARY:
==30820==    definitely lost: 51 bytes in 1 blocks
==30820==    indirectly lost: 0 bytes in 0 blocks
==30820==      possibly lost: 0 bytes in 0 blocks
==30820==    still reachable: 0 bytes in 0 blocks
==30820==         suppressed: 0 bytes in 0 blocks
==30820== 
==30820== For counts of detected and suppressed errors, rerun with: -v
==30820== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

path_begin needs to be free'd up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions