summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com-core_thread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com-core_thread.c b/src/com-core_thread.c
index cb93e4c..0b3172b 100644
--- a/src/com-core_thread.c
+++ b/src/com-core_thread.c
@@ -353,13 +353,16 @@ static void *client_cb(void *data)
ret = secure_socket_recv(tcb->handle, chunk->data, chunk->size, &chunk->pid);
if (ret <= 0) {
+ int chunk_size;
+
+ chunk_size = chunk->size;
+
destroy_chunk(chunk);
if (ret == -EAGAIN) {
- DbgPrint("Retry to get data (%d)\n", chunk->size);
+ DbgPrint("Retry to get data (%d)\n", chunk_size);
continue;
}
-
- DbgPrint("Recv returns: %d (req.size: %d)\n", ret, chunk->size);
+ DbgPrint("Recv returns: %d (req.size: %d)\n", ret, chunk_size);
break;
}