Check size of queue before pushing.

This commit is contained in:
Themaister 2011-01-23 02:04:56 +01:00
parent b0c70231db
commit aaabc3601b

View File

@ -71,6 +71,9 @@ void msg_queue_free(msg_queue_t *queue)
void msg_queue_push(msg_queue_t *queue, const char *msg, unsigned prio, unsigned duration)
{
if (queue->ptr >= queue->size)
return;
struct queue_elem *new_elem = calloc(1, sizeof(struct queue_elem));
new_elem->prio = prio;
new_elem->duration = duration;