Skip to content

Commit d165b26

Browse files
committed
arrow: compress: Use flb_malloc instead of raw malloc and set errno
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent fd343c6 commit d165b26

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/aws/compression/arrow/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ if (ARROW_GLIB_PARQUET_FOUND)
99
target_include_directories(flb-aws-arrow PRIVATE ${ARROW_GLIB_PARQUET_INCLUDE_DIRS})
1010
target_link_libraries(flb-aws-arrow ${ARROW_GLIB_PARQUET_LDFLAGS})
1111
endif()
12+
13+
if(FLB_JEMALLOC)
14+
target_link_libraries(flb-aws-arrow ${JEMALLOC_LIBRARIES})
15+
endif()

src/aws/compression/arrow/compress.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <parquet-glib/parquet-glib.h>
1313
#endif
1414
#include <fluent-bit/flb_log.h>
15+
#include <fluent-bit/flb_mem.h>
1516
#include <inttypes.h>
1617

1718
/*
@@ -258,8 +259,9 @@ int out_s3_compress_parquet(void *json, size_t size, void **out_buf, size_t *out
258259
return -1;
259260
}
260261

261-
buf = malloc(len);
262+
buf = flb_malloc(len);
262263
if (buf == NULL) {
264+
flb_errno();
263265
g_object_unref(buffer);
264266
g_bytes_unref(bytes);
265267
return -1;

0 commit comments

Comments
 (0)