Changeset 691

Show
Ignore:
Timestamp:
21/08/08 08:48:10 (3 months ago)
Author:
markdoliner
Message:

Fix a memory leak when a user signs off. I somehow managed to forget
to free the rate struct used for keeping track of how many stanzas
each user sends. This should have been done in revision 636. My bad.

The leaked memory isn't actually that bad (40 bytes per user, on a
64bit machine). But it results in some pretty bad memory fragmentation,
which causes malloc to perform increasingly slower until the server
is restarted.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/c2s/main.c

    r672 r691  
    777777                } 
    778778            if(sess->rate != NULL) rate_free(sess->rate); 
     779            if(sess->stanza_rate != NULL) rate_free(sess->stanza_rate); 
    779780 
    780781            free(sess); 
  • trunk/ChangeLog

    r660 r691  
     12008-08-21 Mark Doliner <mark@meebo.com> 
     2        * Fix a memory leak when using stanza rate limiting 
     3 
    142008-08-09 Tomasz Sterna <tomek@xiaoka.com> 
    25        * Sending stream errors on SX wrapper errors