summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Hauwaerts <geert@hauwaerts.be>2015-06-12 17:44:13 +0200
committerGeert Hauwaerts <geert@hauwaerts.be>2015-06-12 17:44:13 +0200
commit4cc6fdaaab5db3d22e195b1d0912dae40348e140 (patch)
treeace75521b02e4cced9a31713905a6bada57c3321
parent01510b7d9efd4caa1e41780488658c130224d9cd (diff)
downloadirssi-4cc6fdaaab5db3d22e195b1d0912dae40348e140.zip
Add server check in irc_server_connect (#208)
Fail instead of crash, if irc_server_connect is called without object. (#208)
-rw-r--r--src/irc/core/irc-servers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index d7122eae..c5e1e318 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -314,6 +314,8 @@ SERVER_REC *irc_server_init_connect(SERVER_CONNECT_REC *conn)
void irc_server_connect(SERVER_REC *server)
{
+ g_return_if_fail(server != NULL);
+
if (!server_start_connect(server)) {
server_connect_unref(server->connrec);
g_free(server);