prevent memory corruption in dbengine (#19365)
prevent memory corruption
Costa Tsaousis committed
Jan 10, 2025 at 00:15 UTC
a553390178f74b0740568547418a01746cb2a5a1
1 file changed
+3
-1
src/database/engine/rrdengineapi.c
+3
-1
@@ -911,8 +911,10 @@ void rrdeng_load_metric_finalize(struct storage_engine_query_handle *seqh)
911
pgdc_reset(&handle->pgdc, NULL, UINT32_MAX);
912
}
913
914
- if(!pdc_release_and_destroy_if_unreferenced(handle->pdc, false, false))
914
+ if(handle->pdc) {
915
__atomic_store_n(&handle->pdc->workers_should_stop, true, __ATOMIC_RELAXED);
916
+ pdc_release_and_destroy_if_unreferenced(handle->pdc, false, false);
917
+ }
918
919
unregister_query_handle(handle);
920
rrdeng_query_handle_release(handle);