From 47b1d160aec94dbc31aa0b6a18eea1f824231af4 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 24 Feb 2003 14:56:49 +0000 Subject: [PATCH] Commit fix for segfault in buffer length handling code. svn path=/trunk/icecast/; revision=4365 --- src/refbuf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/refbuf.c b/src/refbuf.c index 9aaa051d..b8396906 100644 --- a/src/refbuf.c +++ b/src/refbuf.c @@ -99,7 +99,10 @@ void refbuf_queue_insert(refbuf_queue_t **queue, refbuf_t *refbuf) item->refbuf = refbuf; item->next = *queue; - item->total_length = item->next->total_length + item->refbuf->len; + if(item->next) + item->total_length = item->next->total_length + item->refbuf->len; + else + item->total_length = item->refbuf->len; *queue = item; }