From 835f8451ac5f297f2f4deb312b71a4d10574c777 Mon Sep 17 00:00:00 2001 From: aln Date: Tue, 28 Jun 2022 17:03:14 +0300 Subject: [PATCH] Fixed memleak and va_end_missing issues --- src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx | 8 +++++++- src/Standard/Standard_Dump.cxx | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx b/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx index 4becc6f98a..3a3f025d8e 100644 --- a/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx +++ b/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx @@ -543,7 +543,11 @@ static Standard_Integer tobezier(Draw_Interpretor& di, if ( C3d.IsNull()) { Handle(Geom_BSplineSurface) S = DrawTrSurf::GetBSplineSurface(a[2]); - if ( S.IsNull()) return 1; + if (S.IsNull()) + { + delete[] name; + return 1; + } if (n == 7) { Standard_Real U1, U2, V1, V2; U1 = Draw::Atof(a[3]); @@ -631,6 +635,8 @@ static Standard_Integer tobezier(Draw_Interpretor& di, } } + delete[] name; + return 0; } diff --git a/src/Standard/Standard_Dump.cxx b/src/Standard/Standard_Dump.cxx index 355db4647a..af65c6c337 100644 --- a/src/Standard/Standard_Dump.cxx +++ b/src/Standard/Standard_Dump.cxx @@ -160,7 +160,10 @@ Standard_Boolean Standard_Dump::InitRealValues (const TCollection_AsciiString& t TCollection_AsciiString aValueText = aSubText.SubString (aStreamPos, aNextPos - 1); if (!aValueText.IsRealValue()) + { + va_end(vl); return Standard_False; + } Standard_Real aValue = aValueText.RealValue(); *(va_arg(vl, Standard_Real*)) = aValue; -- 2.39.5