prevent memory corruption in dbengine (#19363)
prevent memory corruption
Costa Tsaousis committed
Jan 9, 2025 at 23:49 UTC
50fb61d54a22600c3dada553e974d091ba76a4d1
1 file changed
+2
-2
src/database/engine/rrdengineapi.c
+2
-2
@@ -911,8 +911,8 @@ 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))
915
- __atomic_store_n(&handle->pdc->workers_should_stop, true, __ATOMIC_RELAXED);
914
+ __atomic_store_n(&handle->pdc->workers_should_stop, true, __ATOMIC_RELAXED);
915
+ pdc_release_and_destroy_if_unreferenced(handle->pdc, false, false);
916
917
unregister_query_handle(handle);
918
rrdeng_query_handle_release(handle);