diff --git a/Changes b/Changes index 25020110b..6b35127d4 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ Provided by Anope Dev. - 2005 07/01 A Events for channel access/xop updates. [ #00] 06/26 A New module pack module: hs_request. [ #00] 06/03 A Protocol files can now fill mod_current_buffer with custom code. [#389] +08/29 F Memory leak when using mysql to save data. [ #00] 08/29 F Organised docs/FAQ a bit more and slightly restyled it. [ #00] 08/25 F Compiler warnings in tools with gcc4. [ #00] 08/21 F Default config location in example.conf was wrong. [ #00] @@ -426,7 +427,7 @@ Provided by Trystan - 2004 10/14 F Fixed NickServ Logout. [#180] 10/14 F Fixed HelpChannel with Unreal. [#180] 10/09 F Bug in MySQL debug, possibly causing segfaults. [#149] -10/09 F Lots of code clean up to prevent segfaults. [ #00] +10/09 F Lots of code clean up to prevent segfaults. [ #00] 10/07 F Fixed TSMODE ircds that don't stay this in their CAPAB. [ #00] 10/05 F Cleaned up how OS/CS CLEAR MODES works. [ #00] 09/27 F Verbose message for vident. [#173] diff --git a/src/mysql.c b/src/mysql.c index 4eadae97a..af319d5b6 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -413,10 +413,16 @@ void db_mysql_save_cs_info(ChannelInfo * ci) *cbadwords, *efounderpass; ciname = db_mysql_quote(ci->name); - cifoundernick = - ci->founder ? db_mysql_quote(ci->founder->display) : ""; - cisuccessornick = - ci->successor ? db_mysql_quote(ci->successor->display) : ""; + if(ci->founder) { + cifoundernick = db_mysql_quote(ci->founder->display); + } else { + cifoundernick = db_mysql_quote(""); + } + if(ci->successor) { + cisuccessornick = db_mysql_quote(ci->successor->display); + } else { + cisuccessornick = db_mysql_quote(""); + } cifounderpass = db_mysql_quote(ci->founderpass); cidesc = db_mysql_quote(ci->desc); ciurl = db_mysql_quote(ci->url); @@ -429,7 +435,11 @@ void db_mysql_save_cs_info(ChannelInfo * ci) cimlock_flood = db_mysql_quote(ci->mlock_flood); cimlock_redirect = db_mysql_quote(ci->mlock_redirect); cientrymsg = db_mysql_quote(ci->entry_message); - cibotnick = ci->bi ? db_mysql_quote(ci->bi->nick) : ""; + if(ci->bi) { + cibotnick = db_mysql_quote(ci->bi->nick); + } else { + cibotnick = db_mysql_quote(""); + } efounderpass = db_mysql_secure(cifounderpass); free(cifounderpass); @@ -605,26 +615,21 @@ void db_mysql_save_cs_info(ChannelInfo * ci) } free(ciname); - if (!(ci->flags & CI_VERBOTEN)) { - free(cifoundernick); - if (strlen(cisuccessornick) > 0) - free(cisuccessornick); - free(efounderpass); - free(cidesc); - free(ciurl); - free(ciemail); - free(cilasttopic); - free(cilasttopicsetter); - free(cimlock_key); - free(cimlock_flood); - free(cimlock_redirect); - free(cientrymsg); - if (ci->bi) - free(cibotnick); - } else { - free(ciforbidby); - free(ciforbidreason); - } + free(cifoundernick); /* mark */ + free(cisuccessornick); /* mark */ + free(efounderpass); + free(cidesc); + free(ciurl); + free(ciemail); + free(cilasttopic); + free(cilasttopicsetter); + free(cimlock_key); + free(cimlock_flood); + free(cimlock_redirect); + free(cientrymsg); + free(cibotnick); /* mark */ + free(ciforbidby); + free(ciforbidreason); return; }