summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-01-28 20:37:38 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-01-28 20:37:38 +0100
commitc869aa380926b0c57a206543f240585c6ac8ab27 (patch)
tree623d6892178a7fe9fa61d0fbeee3854d7e457991 /src
parent50415dfbb7b2ef88084b6a2e1cc33b542eb7d657 (diff)
downloadweechat-c869aa380926b0c57a206543f240585c6ac8ab27.zip
relay: fix crash on /upgrade when the real IP is not set (closes #1294)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/relay/relay-client.c3
1 files changed, 2 insertions, 1 deletions
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");