void add_poll(int pnum, char *question, sbyte active, sbyte revote)
{
poll_list[pnum].title = strdup(question);
poll_list[pnum].active = active;
poll_list[pnum].revote = revote;
poll_list[pnum].options[0] = strdup("\r\n");
}
void free_poll(void)
{
free(poll_list[pnum].title);
free(poll_list[pnum].options[0]);
}
void free_poll(int pnum)
{
free(poll_list[pnum].title);
free(poll_list[pnum].options[0]);
}
So, I realized that I've got a memory leak but I'm not at all the familiar with memory. I know I need to free it and based on what I've seen in the code, I have some idea of how it works, but not a whole lot. I'm guessing that the free I wrote isn't accurate, but I'm entirely sure what I'm doing, so if someone could help explain it, that would be awesome.
Thanks in advance,
Arholly