Skip to content

Commit

Permalink
DPL: fix small leak when receiving WS messages from the driver (#13871)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf authored Jan 17, 2025
1 parent c10424c commit 518b10d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Framework/Core/src/DPLWebSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ struct GUIWebSocketHandler : public WebSocketHandler {
}
}
}
void endFragmentation() override{};
void control(char const* frame, size_t s) override{};
void beginChunk() override{};
void endChunk() override{};
void endFragmentation() override {};
void control(char const* frame, size_t s) override {};
void beginChunk() override {};
void endChunk() override {};

/// The driver context were we want to accumulate changes
/// which we got from the websocket.
Expand Down Expand Up @@ -415,6 +415,7 @@ void websocket_client_callback(uv_stream_t* stream, ssize_t nread, const uv_buf_
try {
LOG(debug) << "Data received from server";
parse_http_request(buf->base, nread, context->client);
free(buf->base);
} catch (RuntimeErrorRef& ref) {
auto& err = o2::framework::error_from_ref(ref);
LOG(error) << "Error while parsing request: " << err.what;
Expand Down
1 change: 1 addition & 0 deletions Framework/Core/src/runDataProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ void websocket_callback(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
} catch (WSError& e) {
LOG(error) << "Error while parsing request: " << e.message;
handler->error(e.code, e.message.c_str());
free(buf->base);
}
}

Expand Down

0 comments on commit 518b10d

Please sign in to comment.