Changeset 691 for trunk/c2s/main.c

Show
Ignore:
Timestamp:
21/08/08 08:48:10 (5 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.

Files:
1 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);