Valgrind: still reachable memory leaks found in dl-init.c. Are these real memory leaks?

280 Views Asked by At

Leak Summary

1

I'm still new to valgrind and I don't have enough knowledge to evaluate this result. I was able to fix memory leaks in the past but the location of the leaks in my code were indicated, this time I have no idea how to fix a leak found in dl-init.c which is part of GNU C library.

1

There are 1 best solutions below

3
Synopsis On

reachable memory leaks are resources, that your program fetched from the system but did not return during its run - typically by using new().

These are no problem in case of an ensured quick exit (short runner programs) as all ressources are freed automatically upon exit(), but during a longer program run, they block memory, that you MAY have no use for anymore.

Most tend to fix ALL memory leaks for being sure to free up memory again. So care for freeing ALL ressources you aquired and your program is safe for long runs and your prof is happy also.

Only programs that definitely do not vary in run time/work amount can risk to not freeing such ressources. If you leave that, you'll regret it sooner or later for long running things (deamons or a large workload) only fetching ressources but nevert returning them explicitly. This will risk out-of-memory errors for really large tasks or for deamons/services etc.