summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_transfer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_transfer.cpp')
-rw-r--r--protocols/Tox/src/tox_transfer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index cc215c173e..5a1844383b 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -269,6 +269,11 @@ void CToxProto::OnFileSendData(Tox*, uint32_t friendNumber, uint32_t fileNumber,
TOX_ERR_FILE_SEND_CHUNK error;
if (!tox_file_send_chunk(proto->tox, friendNumber, fileNumber, position, data, length, &error))
{
+ if (error == TOX_ERR_FILE_SEND_CHUNK_FRIEND_NOT_CONNECTED)
+ {
+ mir_free(data);
+ return;
+ }
proto->debugLogA(__FUNCTION__": failed to send file chunk (%d)", error);
proto->ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)transfer, 0);
tox_file_control(proto->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, NULL);