Hello community. I need some help with my C program... spent hours and still couldn't figure out what's wrong. I'm kinda freaking out because it's for school and time is running out! There is a function called dbread() that is supposed to read an ini-like file. User provides the file name, section, key and a string where the stored value should go in. Problem is I just can't free memory after I use it, otherwise it just won't work! It gives me memory errors (run-time errors). There are two string vectors dynamicly allocated (char**). Well they can't be dumped.
I'm going to attach two files, one is the program itself and the other is an ini file that should be in the same path as the program. This is a "malloc", "realloc" challange for anyone who feels interested. Please rename db.txt to db.ini, or simply modify the source code. Should work either way.
Thanks in advance for any help.