client session BUGFIX buffered messages
diff --git a/src/session_client.c b/src/session_client.c
index cd296ee..bdcfc4b 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -1722,7 +1722,8 @@
         goto cleanup;
     }
 
-    /* assume a notification, store it */
+    /* assume a notification, reset and store it */
+    ly_in_reset(msg);
     cont_ptr = &session->opts.client.notifs;
     while (*cont_ptr) {
         cont_ptr = &((*cont_ptr)->next);
@@ -1733,6 +1734,7 @@
         goto cleanup;
     }
     (*cont_ptr)->msg = msg;
+    msg = NULL;
     (*cont_ptr)->next = NULL;
 
     ret = NC_MSG_NOTIF;
@@ -1987,7 +1989,8 @@
         goto cleanup;
     }
 
-    /* assume a rpc-reply, store it */
+    /* assume a rpc-reply, reset and store it */
+    ly_in_reset(msg);
     cont_ptr = &session->opts.client.replies;
     while (*cont_ptr) {
         cont_ptr = &((*cont_ptr)->next);
@@ -1998,6 +2001,7 @@
         goto cleanup;
     }
     (*cont_ptr)->msg = msg;
+    msg = NULL;
     (*cont_ptr)->next = NULL;
 
     ret = NC_MSG_REPLY;