Skip to content

Commit

Permalink
Merge 3dfd4f9 into 2ec510a
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis52 committed Jan 3, 2015
2 parents 2ec510a + 3dfd4f9 commit 7ec6d9a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion common/network/TCPConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ TCPConnector::TCPConnectionID TCPConnector::Connect(
return 0;
}
} else {
// connect returned immediately
// Connect returned immediately
// The callback takes ownership of the socket descriptor.
// coverity(RESOURCE_LEAK)
callback->Run(sd, 0);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions common/network/TCPSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ void TCPAcceptingSocket::PerformRead() {
}

if (m_factory) {
// The callback takes ownership of the new socket descriptor
// coverity(RESOURCE_LEAK)
m_factory->NewTCPSocket(sd);
} else {
OLA_WARN << "Accepted new TCP Connection but no factory registered";
Expand Down
3 changes: 3 additions & 0 deletions common/rdm/AckTimerResponder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const RDMResponse *AckTimerResponder::ResponseFromQueuedMessage(
queued_response->ParamDataSize());
break;
case RDMCommand::SET_COMMAND_RESPONSE:
// coverity(SWAPPED_ARGUMENTS)
return new RDMSetResponse(
request->DestinationUID(),
request->SourceUID(),
Expand Down Expand Up @@ -352,6 +353,7 @@ const RDMResponse *AckTimerResponder::SetDmxStartAddress(

uint16_t ack_time = 1 + ACK_TIMER_MS / 100;
ack_time = HostToNetwork(ack_time);
// coverity(SWAPPED_ARGUMENTS)
return new RDMSetResponse(
request->DestinationUID(),
request->SourceUID(),
Expand Down Expand Up @@ -402,6 +404,7 @@ const RDMResponse *AckTimerResponder::SetIdentify(

uint16_t ack_time = 1 + ACK_TIMER_MS / 100;
ack_time = HostToNetwork(ack_time);
// coverity(SWAPPED_ARGUMENTS)
return new RDMSetResponse(
request->DestinationUID(),
request->SourceUID(),
Expand Down
8 changes: 4 additions & 4 deletions plugins/e131/e131/E131PDU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ bool E131PDU::PackData(uint8_t *data, unsigned int *length) const {
void E131PDU::PackHeader(OutputStream *stream) const {
if (m_header.UsingRev2()) {
E131Rev2Header::e131_rev2_pdu_header header;
strncpy(header.source, m_header.Source().data(),
E131Rev2Header::REV2_SOURCE_NAME_LEN);
strings::CopyToFixedLengthBuffer(m_header.Source(), header.source,
arraysize(header.source));
header.priority = m_header.Priority();
header.sequence = m_header.Sequence();
header.universe = HostToNetwork(m_header.Universe());
stream->Write(reinterpret_cast<uint8_t*>(&header),
sizeof(E131Rev2Header::e131_rev2_pdu_header));
} else {
E131Header::e131_pdu_header header;
strncpy(header.source, m_header.Source().data(),
E131Header::SOURCE_NAME_LEN);
strings::CopyToFixedLengthBuffer(m_header.Source(), header.source,
arraysize(header.source));
header.priority = m_header.Priority();
header.reserved = 0;
header.sequence = m_header.Sequence();
Expand Down

0 comments on commit 7ec6d9a

Please sign in to comment.