added owner / group options to options.conf
[lcr.git] / message.c
index 9821265..403253d 100644 (file)
--- a/message.c
+++ b/message.c
@@ -37,8 +37,7 @@ struct lcr_msg *message_create(int id_from, int id_to, int flow, int type)
 /* attaches a message to the end of the message chain */
 void message_put(struct lcr_msg *message)
 {
-       if (message->id_to == 0)
-       {
+       if (message->id_to == 0) {
                PDEBUG(DEBUG_MSG, "message %s not written, because destination is 0.\n", messages_txt[message->type]);
                message_free(message);
                return;
@@ -49,6 +48,8 @@ void message_put(struct lcr_msg *message)
 
        *messagepointer_end = message;
        messagepointer_end = &(message->next);
+       /* Nullify next pointer if recycled messages */
+       *messagepointer_end=NULL;
 }
 
 struct lcr_msg *message_forward(int id_from, int id_to, int flow, union parameter *param)
@@ -75,9 +76,7 @@ struct lcr_msg *message_get(void)
        struct lcr_msg *message;
 
        if (!message_first)
-       {
                return(0);
-       }
 
        message = message_first;
        message_first = message->next;