BUGFIX increase reference counter when returning hello message as a reply
diff --git a/src/netopeerguid.c b/src/netopeerguid.c
index 1015959..fde6598 100644
--- a/src/netopeerguid.c
+++ b/src/netopeerguid.c
@@ -2832,7 +2832,7 @@
ERROR("Error while unlocking rwlock: %d (%s)", errno, strerror(errno));
}
if (locked_session->hello_message != NULL) {
- reply = locked_session->hello_message;
+ reply = json_object_get(locked_session->hello_message);
} else {
reply = create_error_reply("Invalid session identifier.");
}
@@ -2997,7 +2997,7 @@
}
if ((reply == NULL) && (locked_session->hello_message != NULL)) {
- reply = locked_session->hello_message;
+ reply = json_object_get(locked_session->hello_message);
}
return reply;