Skip to content

Commit f8a2f8a

Browse files
committed
fix(ffi): Free sync progress and stats pointers in test_client_resource_cleanup
1 parent 7adef4b commit f8a2f8a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dash-spv-ffi/tests/unit/test_client_lifecycle.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,15 @@ mod tests {
142142
assert!(!client.is_null());
143143

144144
// Do some operations
145-
let _ = dash_spv_ffi_client_get_sync_progress(client);
146-
let _ = dash_spv_ffi_client_get_stats(client);
145+
let progress = dash_spv_ffi_client_get_sync_progress(client);
146+
let stats = dash_spv_ffi_client_get_stats(client);
147+
148+
if !progress.is_null() {
149+
dash_spv_ffi_sync_progress_destroy(progress);
150+
}
151+
if !stats.is_null() {
152+
dash_spv_ffi_spv_stats_destroy(stats);
153+
}
147154

148155
dash_spv_ffi_client_destroy(client);
149156
dash_spv_ffi_config_destroy(config);

0 commit comments

Comments
 (0)