summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/relay/relay-client.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 444fe7908..77a2be615 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -41,6 +41,7 @@ Bug fixes::
* irc: return IRC color code instead of WeeChat color code when decoding a too short ANSI color sequence
* irc: fix encoding of italic attribute when colors are removed
* irc: fix parsing of "time" message tag on FreeBSD (issue #1289)
+ * relay: fix crash on /upgrade when the real IP is not set (issue #1294)
* relay: fix memory leak in connection of client
Tests::
diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c
index b6006110d..ecb1efbca 100644
--- a/src/plugins/relay/relay-client.c
+++ b/src/plugins/relay/relay-client.c
@@ -1414,7 +1414,8 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
new_client->websocket = weechat_infolist_integer (infolist, "websocket");
new_client->http_headers = NULL;
new_client->address = strdup (weechat_infolist_string (infolist, "address"));
- new_client->real_ip = strdup (weechat_infolist_string (infolist, "real_ip"));
+ str = weechat_infolist_string (infolist, "real_ip");
+ new_client->real_ip = (str) ? strdup (str) : NULL;
new_client->status = weechat_infolist_integer (infolist, "status");
new_client->protocol = weechat_infolist_integer (infolist, "protocol");
str = weechat_infolist_string (infolist, "protocol_string");