mirror of
https://github.com/nasa/trick.git
synced 2024-12-20 21:53:10 +00:00
remove dead assignment and memory leaks var.cpp
This commit is contained in:
parent
605f5d0f6d
commit
a60cc3f2ae
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user