From ed50fb9f5a03e0a7ad971295901a2af8b8125b6c Mon Sep 17 00:00:00 2001 From: Elliana May Date: Sun, 14 Apr 2024 17:03:37 +0800 Subject: [PATCH] fix: don't segfault on errors --- src/vtab/arrow.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vtab/arrow.rs b/src/vtab/arrow.rs index bab55d49..dddb6541 100644 --- a/src/vtab/arrow.rs +++ b/src/vtab/arrow.rs @@ -110,6 +110,7 @@ impl VTab for ArrowVTab { output.set_len(0); } else { let rb = Box::from_raw((*bind_info).rb); + (*bind_info).rb = null_mut(); // erase ref in case of failure in record_batch_to_duckdb_data_chunk record_batch_to_duckdb_data_chunk(&rb, output)?; (*bind_info).rb = Box::into_raw(rb); (*init_info).done = true;