#1138267 nvtop: Memory leak with Intel GPU

Package:
nvtop
Source:
nvtop
Description:
Neat Videocard TOP
Submitter:
Alexander Inyukhin
Date:
2026-05-30 09:21:01 UTC
Severity:
normal
Tags:
#1138267#5
Date:
2026-05-30 09:17:57 UTC
From:
To:
Dear nvtop maintainers!

I have identified two separate memory leaks within nvtop 3.2.0-1.
These leaks occur under specific circumstances and can lead to increased
memory usage over time.

The first leak appears to occur within the hardware monitoring (hwmon)
enumeration code. Specifically, the enumerator object is not properly
freed when errors are encountered during enumeration, resulting in a
leak.

The second leak is related to the handling of temporary object during
dynamic data updates on intel gpus. This object is created and used but not
subsequently deallocated.

I have attached the output of `valgrind --leak-check=full nvtop -s`
which demonstrates these memory leaks.

I have developed patches to address both of these issues. The patches
ensure proper cleanup of the enumerator object in the hwmon enumeration
code and correct the deallocation of temporary objects used in dynamic
data updates.

Attachments:
* `valgrind_output.txt` (Output from `valgrind --leak-check=full nvtop -s`)
* `hwmon_leak_fix.patch` (Patch for hwmon enumeration leak)
* `dynamic_data_leak_fix.patch` (Patch for dynamic data update leak)

I would greatly appreciate it if you would consider reviewing and
applying these patches to resolve these memory leak issues in future
releases of nvtop.

Thank you for your time and consideration.