diff options
author | Timo Sirainen <cras@irssi.org> | 2001-05-01 11:37:50 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-05-01 11:37:50 +0000 |
commit | de3116ef54c4cbb9eb48dd041e8e3204d6175bc4 (patch) | |
tree | 402502bd411e0ae0e82ee3301edc52203535d196 /src/irc/flood/flood.c | |
parent | 6d4f2ab6fa7ac126765a3d7f4acca1a0c2ff6a09 (diff) | |
download | irssi-de3116ef54c4cbb9eb48dd041e8e3204d6175bc4.zip |
fixed potential crash
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1459 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/flood/flood.c')
-rw-r--r-- | src/irc/flood/flood.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/irc/flood/flood.c b/src/irc/flood/flood.c index 89ae0f84..5381b1cc 100644 --- a/src/irc/flood/flood.c +++ b/src/irc/flood/flood.c @@ -61,10 +61,12 @@ static int flood_hash_check_remove(const char *key, FLOOD_REC *flood, next = tmp->next; /* remove old time entries for current rec item */ for (times = rec->msgtimes; times != NULL; times = tnext) { + time_t *data = times->data; tnext = times->next; + if (*now-*((time_t *) times->data) >= flood_timecheck) { - rec->msgtimes = g_slist_remove(rec->msgtimes, times->data); - g_free(times->data); + rec->msgtimes = g_slist_remove(rec->msgtimes, data); + g_free(data); } } /* if no more time entries remove rec item */ |