Leif Jackson wrote:
> Here i go again.... checked dbmail-lmtpd and it has 2 minor problems:
>
> first:
>
> --- dbmail-svn-2.1.3-2000.orig/lmtp.c 2006-03-01 01:46:40.939279000 -0500
> +++ dbmail-svn-2.1.3-2000.new/lmtp.c 2006-03-01 03:45:56.648141000 -0500
> @@ -476,6 +476,8 @@
> if (goodtogo) {
> /* Sure fine go ahead. */
> dm_list_nodeadd(&from, tmpaddr, strlen(tmpaddr)+1);
> + /* free tmpaddr as dm_list_nodeadd makes a copy */
> + dm_free(tmpaddr);
> ci_write((FILE *) stream,
> "250 Sender <%s> OK\r\n",
> (char *)(dm_list_getstart(&from)->data));
>
> Simple fix but an issue none the less. Then there is the 2nd one....
Applied.
>
> in lmtp.c around line 516:
>
> /* find_bounded() allocated tmpaddr for us, and that's ok
> * since dsnuser_free() will free it for us later on. */
> dsnuser.address = tmpaddr;
>
> but the comment isn't true thus this leaks ? What do you guys want to do
> with this?
>
> void dsnuser_free(deliver_to_user_t * dsnuser)
> {
> dsnuser->useridnr = 0;
> dsnuser->dsn.class = 0;
> dsnuser->dsn.subject = 0;
> dsnuser->dsn.detail = 0;
>
> /* These are nominally const, but
> * we really do want to free them. */
> /*
> dm_free((char *) dsnuser->address);
> dm_free((char *) dsnuser->mailbox);
> */
> dsnuser->address = NULL;
> ....
I'm activating these free calls. They should be used since mailbox and
address are allocated in all use-cases.
I want to test some more to make sure I'm not introducing any
double-frees before I commit.
--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl