Using valgrind

Joe Nelson joe at
Wed Nov 7 22:46:45 UTC 2018

I was doing a K&R exercise and noticed a place in the
code that might have a small memory leak. This section returns
NULL if either a structure or a string fail to be allocated.  However if
the structure succeeded and strdup failed then it would never free the

Rather than fix it and move on, I wondered if it would be a good
opportunity to learn some tooling. Maybe could
detect the error. Have any of you used Valgrind before?

More information about the Friends mailing list