const char *service = NULL;
const char *thread = NULL;
const char *log_xid = NULL;
+ char *tmp_recip = NULL;
char *msg_body = NULL;
char *recipient = NULL;
"WS relaying message to opensrf thread=%s, recipient=%s",
thread, recipient);
- msg_body = extract_inbound_messages(
- service, thread, recipient, osrf_msg);
+ // 'recipient' will be freed in extract_inbound_messages
+ // during a DISCONNECT call. Retain a local copy.
+ tmp_recip = strdup(recipient);
+
+ msg_body = extract_inbound_messages(service, thread, recipient, osrf_msg);
osrfLogInternal(OSRF_LOG_MARK,
"WS relaying inbound message: %s", msg_body);
transport_message *tmsg = message_init(
- msg_body, NULL, thread, recipient, NULL);
+ msg_body, NULL, thread, tmp_recip, NULL);
+
+ free(tmp_recip);
message_set_osrf_xid(tmsg, osrfLogGetXid());