Repository: nifi-minifi-cpp Updated Branches: refs/heads/master d7885d6bd -> 23ca420c4
MINIFICPP-645 - Move from new to malloc in CAPI to facilitate eventual change from C++ to C This closes #439. Signed-off-by: Marc Parisi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/23ca420c Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/23ca420c Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/23ca420c Branch: refs/heads/master Commit: 23ca420c48527a63446a8099c65bba9cf28c8a72 Parents: d7885d6 Author: Arpad Boda <[email protected]> Authored: Thu Nov 15 13:00:07 2018 +0100 Committer: Marc Parisi <[email protected]> Committed: Fri Nov 16 12:53:31 2018 -0500 ---------------------------------------------------------------------- nanofi/src/api/nanofi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/23ca420c/nanofi/src/api/nanofi.cpp ---------------------------------------------------------------------- diff --git a/nanofi/src/api/nanofi.cpp b/nanofi/src/api/nanofi.cpp index 7a06bfc..290a0ec 100644 --- a/nanofi/src/api/nanofi.cpp +++ b/nanofi/src/api/nanofi.cpp @@ -205,7 +205,7 @@ flow_file_record* create_ff_object(const char *file, const size_t len, const uin } 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)); new_ff->attributes = nullptr; new_ff->contentLocation = (char*) malloc(sizeof(char) * (len + 1)); snprintf(new_ff->contentLocation, len + 1, "%s", file); @@ -463,7 +463,7 @@ int set_standalone_property(standalone_processor *proc, const char *name, const int free_flow(flow *flow) { if (flow == nullptr) return -1; - delete flow; + free(flow); return 0; }
