Fixed missing free on malloc, no more crashing!

This commit is contained in:
Pentium44 2021-08-15 03:12:56 -04:00
parent 40f9056774
commit 01d751aa42
2 changed files with 4 additions and 2 deletions

View File

@ -98,8 +98,10 @@ char *process_string(char *in, int n) {
if(strncmp(msg, searchstr, strlen(searchstr))==0) { if(strncmp(msg, searchstr, strlen(searchstr))==0) {
sprintf(b,"PRIVMSG %s :%s, %s\r\n",chan, sprintf(b,"PRIVMSG %s :%s, %s\r\n",chan,
name,dictionary[k].reply); name,dictionary[k].reply);
if(searchstr != NULL) free(searchstr);
return b; return b;
} }
if(searchstr != NULL) free(searchstr);
} }
/*if(strncmp(msg, "@topic", 4)==0) { /*if(strncmp(msg, "@topic", 4)==0) {

View File

@ -2,7 +2,7 @@
YOURUSER="Pentium44" YOURUSER="Pentium44"
BOTNICK="MultiServ" BOTNICK="MultiServ"
BOTPASS="changemeeeee" BOTPASS="changeme"
ADDRESS="localhost" ADDRESS="localhost"
PORT="1337" PORT="1337"