From a60cc3f2aec120e979f746c56fc8264f5e996c0b Mon Sep 17 00:00:00 2001 From: Scott Fennell Date: Mon, 1 Oct 2018 14:28:26 -0500 Subject: [PATCH] remove dead assignment and memory leaks var.cpp --- trick_source/data_products/Var/var.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trick_source/data_products/Var/var.cpp b/trick_source/data_products/Var/var.cpp index b89dfb67..35108a54 100644 --- a/trick_source/data_products/Var/var.cpp +++ b/trick_source/data_products/Var/var.cpp @@ -466,6 +466,7 @@ int Var::getDimOffset( const char* param ) { if ( offset < 0 ) { fprintf(stderr, "ERROR: Integer overflow " "calculating offset!\n"); + VAR_DELETE; return(-1); } } @@ -661,7 +662,6 @@ int Var::calcNumDimensions() { if ( varName_[i] == '[' ) { - j = 0; while ( varName_[i] != ']' ) { i++ ; @@ -746,6 +746,8 @@ int Var::calcNumDimensions() { cerr << "ERROR: Bad syntax in dimension " << "specification for " << varName_ << endl ; + delete[] dim1 ; + delete[] dim2 ; return( -1 ); }