You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2007/06/20 15:11:47 UTC

[Bug 5531] New: libspamc leaks tp->hosts array

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531

           Summary: libspamc leaks tp->hosts array
           Product: Spamassassin
           Version: 3.2.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: jm@jmason.org


int transport_setup(struct transport *tp, int flags)

copies pointers from getaddrinfo() into tp->hosts, but they are never freed
using the required freeaddrinfo().
there's this:

#ifdef SPAMC_HAS_ADDRINFO
    for(numloops=0;numloops<tp->nhosts;numloops++) {
        freeaddrinfo(tp->hosts[numloops]);
    }
#endif

but that is only run for an error condition. :(

We need something to frees the tp->hosts array when no longer used. this may
require addition of a transport_finish() or transport_free() func to the API.

_randomize_hosts() also needs to call freeaddrinfo() as it removes entries.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From jm@jmason.org  2007-06-25 09:29 -------
done!



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #4016 is|0                           |1
           obsolete|                            |




------- Additional Comments From jm@jmason.org  2007-06-25 09:29 -------
Created an attachment (id=4021)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4021&action=view)
fix r2

this is slightly cleaner, and is what I'm applying to trunk just now...

: jm 77...; svn commit -m "bug 5531: transport_setup() leaks a small amount of
memory each time it's called; fix, by adding a API for SA 3.3.0,
transport_cleanup()"
Sending        spamc/libspamc.c
Sending        spamc/libspamc.h
Transmitting file data ..
Committed revision 550538.

also (trivial): added a doc comment to libspamc.h in 3.2.x:

: jm 185...; svn commit -m "bug 5531: transport_setup() leaks a small amount of
memory each time it's called; document this in a comment" spamc/libspamc.h
Sending        spamc/libspamc.h
Transmitting file data .
Committed revision 550539.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.2.2                       |3.3.0






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
   Target Milestone|Undefined                   |3.2.2






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |5462






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531





------- Additional Comments From jm@jmason.org  2007-06-22 09:36 -------
Created an attachment (id=4016)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4016&action=view)
fix

ok, here's a fix.  It adds a new API, transport_cleanup() -- named to
match the existing message_cleanup().  

I couldn't think of a better way to do this than to add a new API,
unfortunately. :(

Since it's a new API, I added a #define so that callers could tell if it exists
or not; I also recommend we do not add this to 3.2.x, instead keeping it for
3.3.0.	(the amount of RAM leaked is pretty trivial, and unlikely to affect
anyone not using libspamc repeatedly in one process.)

I'll check it into trunk once the 3.2.x queue clears out...



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5531] libspamc leaks tp->hosts array

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5531


Bug 5531 depends on bug 5462, which changed state.

Bug 5462 Summary: [review] spamc -H randomization is broken
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5462

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.