astitcher commented on code in PR #431:
URL: https://github.com/apache/qpid-proton/pull/431#discussion_r1695772565


##########
c/src/core/codec.c:
##########
@@ -431,6 +431,7 @@ void pn_data_clear(pn_data_t *data)
     data->current = 0;
     data->base_parent = 0;
     data->base_current = 0;
+    data->error = NULL;

Review Comment:
   Pretty sure this code is wrong - despite passing the tests:
   If there was a an error attached to the pn_data_t then it would be leaked by 
just setting the field to NULL. This needs ```pn_error_free(data->error);``` 
first.
   As an alternative you could use ```pn_error_clear(data->error);``` instead, 
which will overall do a little less work whilst giving the same effect.



-- 
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: dev-unsubscr...@qpid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to