332
I got to avoid memory management for quite some time
(feddit.org)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
I found the mistake. Since the country code char array only has a size of 2 it overwrites the \0 char causing the memory to leak.
Usually what's meant by a memory leak is memory that's allocated but never freed. Writing outside of array allocation would usually be considered an overflow. Which sounds kinda similar but is not the same.
Bingo. I thought something probably happened to your terminator.