summaryrefslogtreecommitdiff
path: root/src/daemon/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/connection.c')
-rw-r--r--src/daemon/connection.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index d99a88c2..03875559 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -927,10 +927,11 @@ MHD_call_connection_handler (struct MHD_Connection *connection)
(connection->uploadSize == -1) && (connection->socket_fd == -1)))
{
connection->bodyReceived = 1;
- MHD_pool_reallocate(connection->pool,
- (connection->read_buffer == NULL) ? 0 : connection->read_buffer_size + 1,
- connection->read_buffer_size,
- 0);
+ if (connection->read_buffer != NULL)
+ MHD_pool_reallocate(connection->pool,
+ connection->read_buffer,
+ (connection->read_buffer == NULL) ? 0 : connection->read_buffer_size + 1,
+ 0);
connection->readLoc = 0;
connection->read_buffer_size = 0;
connection->read_buffer = NULL;