From de3116ef54c4cbb9eb48dd041e8e3204d6175bc4 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 1 May 2001 11:37:50 +0000 Subject: fixed potential crash git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1459 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/flood/flood.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/irc/flood') 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 */ -- cgit v1.2.3