Skip to content

Commit

Permalink
EXODIFF: Fix memory issue with cached static vector size
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Nov 18, 2024
1 parent bc230be commit 91b34a6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/seacas/applications/exodiff/exo_read.C
Original file line number Diff line number Diff line change
Expand Up @@ -760,21 +760,15 @@ const double *Exo_Read<INT>::Get_Nodal_Results(int t1, int t2, double proportion
return nullptr;
}

if (st_results.empty()) {
st_results.resize(num_nodes);
}

st_results.resize(num_nodes);
int err = ex_get_var(file_id, t1, EX_NODAL, var_index + 1, 0, num_nodes, st_results.data());
if (err < 0) {
Error("Exo_Read::Get_Nodal_Results(): Failed to get "
"nodal variable values! Aborting...\n");
}

if (t1 != t2) {
if (st_results2.empty()) {
st_results2.resize(num_nodes);
}

st_results2.resize(num_nodes);
err = ex_get_var(file_id, t2, EX_NODAL, var_index + 1, 0, num_nodes, st_results2.data());
if (err < 0) {
Error("Exo_Read::Load_Nodal_Results(): Failed to get "
Expand Down

0 comments on commit 91b34a6

Please sign in to comment.