reset after free
diff --git a/src/mod_netconf.c b/src/mod_netconf.c
index 1cc502b..7a71e17 100644
--- a/src/mod_netconf.c
+++ b/src/mod_netconf.c
@@ -288,6 +288,7 @@
 			/* use previous sid */
 			json_object_object_add(s->hello_message, "sid", json_object_new_string(old_sid));
 			free(old_sid);
+			old_sid = NULL;
 		} else {
 			/* we don't have old sid */
 			json_object_object_add(s->hello_message, "sid", json_object_new_string(nc_session_get_id(session)));