Thread View: comp.bugs.2bsd
1 messages
1 total messages
Started by Steven M. Schultz
Sat, 22 Jul 1989 04:06
Memory Leak In sendmail alias handling
Author: Steven M. Schultz
Date: Sat, 22 Jul 1989 04:06
Date: Sat, 22 Jul 1989 04:06
55 lines
1906 bytes
1906 bytes
There is a major memory leak in sendmail's building of
the dbm alias database from /usr/lib/aliases. Large numbers
of aliases will cause sendmail to run out of memory, leaving
partially constructed dbm files.
The earlier fix i posted for this problem was incomplete (and
partially incorrect), this patch corrects both problems.
Apply the following patch to src/sendmail/alias.c and recompile
sendmail.
*** alias.c.old Wed Mar 8 14:54:25 1989
--- alias.c Fri Jul 21 13:39:46 1989
***************
*** 453,459 ****
break;
if (parseaddr(p, &bl, -1, ',') == NULL)
usrerr("%s... bad address", p);
! free(bl);
p = DelimChar;
}
}
--- 453,460 ----
break;
if (parseaddr(p, &bl, -1, ',') == NULL)
usrerr("%s... bad address", p);
! if (bl.q_host && bl.q_host[0])
! free(bl.q_host);
p = DelimChar;
}
}
***************
*** 499,505 ****
content.dsize = rhssize;
content.dptr = rhs;
store(key, content);
! free(al);
}
else
# endif DBM
--- 500,511 ----
content.dsize = rhssize;
content.dptr = rhs;
store(key, content);
! if (al.q_paddr)
! free(al.q_paddr);
! if (al.q_host)
! free(al.q_host);
! if (al.q_user)
! free(al.q_user);
}
else
# endif DBM
======================================================================
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads