Use the correct free function to free plugin data.

The array was created with `mju_malloc` (which does an aligned alloc) and released with `free` (which doesn't care about alignment), which led to errors on Windows.

PiperOrigin-RevId: 578186714
Change-Id: I193987bed061e945c49d7268a9a9af3f17af362a
This commit is contained in:
Nimrod Gileadi
2023-10-31 08:06:20 -07:00
committed by Copybara-Service
parent 7069976557
commit 64a59bb2dc
+1 -1
View File
@@ -1232,7 +1232,7 @@ mjData* mj_copyData(mjData* dest, const mjModel* m, const mjData* src) {
// restore plugin_data
if (plugin_data_size) {
memcpy(dest->plugin_data, save_plugin_data, plugin_data_size);
free(save_plugin_data);
mju_free(save_plugin_data);
save_plugin_data = NULL;
}