[ 
https://issues.apache.org/jira/browse/GEODE-10098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502582#comment-17502582
 ] 

ASF GitHub Bot commented on GEODE-10098:
----------------------------------------

mreddington commented on a change in pull request #943:
URL: https://github.com/apache/geode-native/pull/943#discussion_r821142656



##########
File path: cppcache/src/TcrMessage.cpp
##########
@@ -1373,14 +1360,10 @@ void TcrMessage::handleByteArrayResponse(
 
     case TcrMessage::LOCAL_CREATE:
     case TcrMessage::LOCAL_UPDATE: {
-      int32_t regionLen = input.readInt32();
+      m_regionName.resize(input.readInt32());

Review comment:
       The code never cared before. But I'll add a `min`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> TcrConnection::readMessage should not be explicitly allocating memory
> ---------------------------------------------------------------------
>
>                 Key: GEODE-10098
>                 URL: https://issues.apache.org/jira/browse/GEODE-10098
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Blake Bender
>            Priority: Major
>              Labels: pull-request-available
>
> This method calls new to read an array of bytes, then returns it to the 
> caller, whose responsibility is to delete it (what the heck???).  Even 
> better, the memory is deleted in a call to TcrMessage::setData, so not even 
> in the same class.  If this memory was a std::vector<int8_t>, we could 
> probably take advantage of move semantics and maybe even improve performance 
> a bit, in addition to avoiding potential leaks and weirdness...



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to