Skip to content

Commit

Permalink
[occ] avoid a leak in JsonMessage::Deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
knopers8 authored and teo committed Jul 5, 2024
1 parent 6f9c094 commit 1351c25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion occ/plugin/litestructs/JsonMessage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ bool OccLite::nopb::JsonMessage::Deserialize(::grpc::ByteBuffer* byte_buffer)

if (!status.ok()) {
OLOG(error) << "Cannot dump JsonMessage slices, error code " << status.error_code() << " " << status.error_message() << " " << status.error_details();
delete slices;
return false;
}

Expand All @@ -75,7 +76,7 @@ bool OccLite::nopb::JsonMessage::Deserialize(::grpc::ByteBuffer* byte_buffer)
}

OLOG(detail) << "Deserialized JsonMessage: " << ss.str();

delete slices;
return Deserialize(ss.str());
}

Expand Down

0 comments on commit 1351c25

Please sign in to comment.