[Mimedefang] Mimedefang with postfix. Process memory usage over time.

Dianne Skoll dfs at roaringpenguin.com
Fri Nov 10 16:09:23 EST 2017


On Fri, 10 Nov 2017 13:18:15 -0500
Robert Theisen <trobert at redhat.com> wrote:

> {
>     struct privdata *data;
>     char *val;
>     char buf[256];
>     if (*macro && *(macro+1)) {
>         /* Longer than 1 char -- use curlies */
>         snprintf(buf, sizeof(buf), "{%s}", macro);
>         val = smfi_getsymval(ctx, buf);
>     } else {
>         val = smfi_getsymval(ctx, macro);
>     }
>  ...
> }

> 
> at         snprintf(buf, sizeof(buf), "{%s}", macro);
> 
> that buf[256] is not getting cleaned up even though it is a local
> variable that is falling out of scope?

Um what?  There's nothing to clean up.  CLeaning that up simply
involves the C compiler incrementing the stack pointer by sizeof(buf);
it's an automatic variable.

> The strike against that theory would be that my memory dump shows that
> the "i" and "j" variables are included in that memory chunk.  But the
> single character i and j values are never copied to the local buf[256]
> variable.

If you're linking against a version of libmilter older than 8.14.4, the
library has a memory leak in it that could be causing this.

Regards,

Dianne.



More information about the MIMEDefang mailing list