Explorar o código

* Fixed a memory leak in the cookie checking functions.

svn: 2718
Bryan Drewery %!s(int64=20) %!d(string=hai) anos
pai
achega
f5f5cb4c33
Modificáronse 2 ficheiros con 2 adicións e 0 borrados
  1. 1 0
      doc/UPDATES
  2. 1 0
      src/mod/irc.mod/irc.c

+ 1 - 0
doc/UPDATES

@@ -62,6 +62,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed a startup segfault. (fixes #195)
 * Unsetting auth-prefix disables authing/cmds.
 * Fixed segfault in cmd_slowpart (#191)
+* Fixed a memory leak in the cookie checking functions.
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 1 - 0
src/mod/irc.mod/irc.c

@@ -316,6 +316,7 @@ checkcookie(char *chn, char *bnick, char *cookie)
   /* hash!rand@ts */
   strtolower(bnick);
   simple_sprintf(tohash, "%c%s%s%s%s%c", settings.salt2[0], bnick, chname, &ts[4], randstring, settings.salt2[15]);
+  free(chname);
   hash = MD5(tohash);
   if (!(hash[8] == cookie[0] && hash[16] == cookie[1] && hash[18] == cookie[2]))
     return BC_HASH;