diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-10-13 17:54:57 +0200 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-10-20 15:14:10 +0200 |
commit | 9f0dc4766c7aa80e34aa2cde94323fb49971abdf (patch) | |
tree | b5fd80c74161556f0e7253bba76468eda0ffa635 /src/irc/dcc/dcc-send.c | |
parent | 016fd344362ddcc4b1a0781df9ac2416acc54e69 (diff) | |
download | irssi-9f0dc4766c7aa80e34aa2cde94323fb49971abdf.zip |
fix dcc issue
Diffstat (limited to 'src/irc/dcc/dcc-send.c')
-rw-r--r-- | src/irc/dcc/dcc-send.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/irc/dcc/dcc-send.c b/src/irc/dcc/dcc-send.c index ca29b9b9..912129b7 100644 --- a/src/irc/dcc/dcc-send.c +++ b/src/irc/dcc/dcc-send.c @@ -237,6 +237,12 @@ static SEND_DCC_REC *dcc_send_create(IRC_SERVER_REC *server, dcc->queue = -1; dcc_init_rec(DCC(dcc), server, chat, nick, arg); + if (dcc->module_data == NULL) { + /* failed to successfully init; TODO: change API */ + g_free(dcc); + return NULL; + } + return dcc; } @@ -417,6 +423,10 @@ static int dcc_send_one_file(int queue, const char *target, const char *fname, dcc = dcc_send_create(server, chat, target, str); g_free(str); + if (dcc == NULL) { + g_warn_if_reached(); + return FALSE; + } dcc->handle = handle; dcc->port = port; |