[JDEV] Memory leak in jabberd 1.4.2

Eugeny Korekin az at ftc.ru
Mon Mar 24 05:03:51 CST 2003


Eugeny Korekin <az at ftc.ru> writes:

> I've found outh, that there is a memory leak in jabberd 1.4.2 and
> jabberd14 from cvs. When jabberd is using external xdb authentification
> module(i use xdb_auth_cpile), and user tries to login with _wrong_
> password, jabberd aallocates some memory, and do not frees it after auth
> attempt. When user uses right password, all is ok. After many
> unsuccesful auth attempts jabberd crashes.

I has found cause of memory leaks:

*** jabberd/xdb.c	Tue Feb 25 07:35:13 2003
--- /home/az/src/jabberd/jabberd/xdb.c	Mon Mar 24 13:54:37 2003
***************
*** 67,74 ****
      }
  
      /* associte only a non-error packet w/ waiting cache */
!     if(j_strcmp(xmlnode_get_attrib(p->x,"type"),"error") == 0)
          curx->data = NULL;
      else
          curx->data = p->x;
  
--- 67,76 ----
      }
  
      /* associte only a non-error packet w/ waiting cache */
!     if(j_strcmp(xmlnode_get_attrib(p->x,"type"),"error") == 0){
          curx->data = NULL;
+         pool_free(p->p);
+     }
      else
          curx->data = p->x;
  
***************

However, jabberd crashes even without that leak. If result from xdb
doesn't comes fast (faster then few seconds), jabberd may crash.
When i use pam module of xdb_cpile, this is the usual case, cause
there is some delay, when pam answers to request with wrong password.

When result comes fast (like, when i use xdb_cpile ldap module with
local ldap server), jabberd doesn't crash even with many concurrent connections.


-- 
	WBW, Eugeny <az at ftc ru>

Quigley's Law:
	Whoever has any authority over you, no matter how small, will
	atttempt to use it.



More information about the JDev mailing list