Browse Source

replace malloc in session/session.c with quick fit approach.

release0.1.5
Georg Hopp 12 years ago
parent
commit
dfffcee443
  1. 4
      src/session/session.c

4
src/session/session.c

@ -45,7 +45,7 @@ sessionCtor(void * _this, va_list * params)
this->livetime = time(NULL) + SESSION_LIVETIME;
this->id = sdbm((unsigned char *)uname, nuname) ^ this->livetime;
this->username = malloc(nuname + 1);
this->username = memMalloc(nuname + 1);
this->username[nuname] = 0;
memcpy(this->username, uname, nuname);
@ -58,7 +58,7 @@ sessionDtor(void * _this)
{
Session this = _this;
FREE(this->username);
MEM_FREE(this->username);
}
INIT_IFACE(Class, sessionCtor, sessionDtor, NULL);

Loading…
Cancel
Save