MINIFICPP-645 - Move from new to malloc in CAPI to facilitate eventua…#439
MINIFICPP-645 - Move from new to malloc in CAPI to facilitate eventua…#439arpadboda wants to merge 1 commit intoapache:masterfrom
Conversation
|
|
||
| flow_file_record* create_ff_object_na(const char *file, const size_t len, const uint64_t size) { | ||
| flow_file_record *new_ff = new flow_file_record; | ||
| flow_file_record *new_ff = (flow_file_record*) malloc(sizeof(flow_file_record)); |
There was a problem hiding this comment.
Happy newless year! :)
phrocker
left a comment
There was a problem hiding this comment.
sorry for the pre-mature approval. must change the delete to free due to avoid heap corruption.
|
There is no delete, it was wrong before, this PR just fixes: The last line is the one that frees. |
Ah sorry, I was referencing the fact that over the course of PRs we've gone back and forth a little between malloc/new. There is a free_flow(flow *) that still uses delete. Happy to see a different PR if you prefer to do that, but it all falls under the guise of this ticket IMO. Would you prefer I merge this and then keep the ticket open as a blocker for the free? No real preference on my part. |
…l change from C++ to C
8b0e39d to
5afacc1
Compare
…l change from C++ to C This closes apache#439. Signed-off-by: Marc Parisi <phrocker@apache.org>
…l change from C++ to C
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically master)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.