diff options
| author | drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-02-04 15:54:32 +0000 |
|---|---|---|
| committer | drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-02-04 15:54:32 +0000 |
| commit | 8d6b3b17fc6ef6af58e4b0017290023469bcadf4 (patch) | |
| tree | 6fad3640338639f973355c2321755b2016040f59 /src/botserv.c | |
| parent | 395f3edaccb10fce088b2426bd38026ab593fdec (diff) | |
BUILD : 1.7.21 (1365) BUGS : 850, 851, 852 NOTES : Fixed several memory leaks reported by Trystan. Do not forget to free allocated memory!
git-svn-id: svn://svn.anope.org/anope/trunk@1365 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1080 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/botserv.c')
| -rw-r--r-- | src/botserv.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/botserv.c b/src/botserv.c index 8f76fa5f9..cc2dadd89 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -282,6 +282,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) && (stristr(nbuf, wordbuf)))) { mustkick = 1; } + + /* free previous (sc)allocated memory (#850) */ + free(wordbuf); } } } else if (bw->type == BW_START) { @@ -341,13 +344,16 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) bot_kick(ci, u, BOT_REASON_BADWORD_GENTLE); else bot_kick(ci, u, BOT_REASON_BADWORD, bw->word); + + /* free the normalized buffer before return (#850) */ + Anope_Free(nbuf); + return; } } /* Free the normalized buffer */ - if (nbuf) - free(nbuf); + Anope_Free(nbuf); } /* Flood kicker */ |
