From 21aa6887873b93af53ed1c53fa5cdbe54eda307b Mon Sep 17 00:00:00 2001 From: "Michael H. Scott" Date: Thu, 11 Apr 2024 10:32:46 -0700 Subject: [PATCH] Update MixedBeamColumnAsym3d.cpp Memory leak in `revertToStart` --- SRC/element/mixedBeamColumn/MixedBeamColumnAsym3d.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SRC/element/mixedBeamColumn/MixedBeamColumnAsym3d.cpp b/SRC/element/mixedBeamColumn/MixedBeamColumnAsym3d.cpp index c2ff00e80a..40231b4f6a 100644 --- a/SRC/element/mixedBeamColumn/MixedBeamColumnAsym3d.cpp +++ b/SRC/element/mixedBeamColumn/MixedBeamColumnAsym3d.cpp @@ -959,8 +959,10 @@ int MixedBeamColumnAsym3d::revertToStart() //perform transformation - transform axial force form centroid to shear center kr.addMatrixTripleProduct(0.0, Tr, kv, 1.0); - Ki = new Matrix(crdTransf->getInitialGlobalStiffMatrix(kr)); - + if (Ki == 0) + Ki = new Matrix(NEGD,NEGD); + *Ki = crdTransf->getInitialGlobalStiffMatrix(kr); + // Vector V is zero at initial state V.Zero(); committedV.Zero();