mirror of
https://github.com/nasa/trick.git
synced 2025-01-02 03:16:43 +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 ) {
|
if ( offset < 0 ) {
|
||||||
fprintf(stderr, "ERROR: Integer overflow "
|
fprintf(stderr, "ERROR: Integer overflow "
|
||||||
"calculating offset!\n");
|
"calculating offset!\n");
|
||||||
|
VAR_DELETE;
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -661,7 +662,6 @@ int Var::calcNumDimensions() {
|
|||||||
|
|
||||||
if ( varName_[i] == '[' ) {
|
if ( varName_[i] == '[' ) {
|
||||||
|
|
||||||
j = 0;
|
|
||||||
while ( varName_[i] != ']' ) {
|
while ( varName_[i] != ']' ) {
|
||||||
|
|
||||||
i++ ;
|
i++ ;
|
||||||
@ -746,6 +746,8 @@ int Var::calcNumDimensions() {
|
|||||||
cerr << "ERROR: Bad syntax in dimension "
|
cerr << "ERROR: Bad syntax in dimension "
|
||||||
<< "specification for "
|
<< "specification for "
|
||||||
<< varName_ << endl ;
|
<< varName_ << endl ;
|
||||||
|
delete[] dim1 ;
|
||||||
|
delete[] dim2 ;
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user