[Solved] Valgrind detects memory leak, can’t find it C
[ad_1] Your initDictionary doesn’t return the pointer dictionary anywhere. That means when you do Dictionary* dictionary = initDictionary(); the value of dictionary will be indeterminate (seemingly random or garbage), and dereferencing this pointer or passing it to free will result in undefined behavior. You solve this by adding a simple return dictionary; at the end … Read more