Skip to content

Commit

Permalink
BUG: Resource leak in testMetaObject.cxx.
Browse files Browse the repository at this point in the history
Fix two resource leaks reported by Coverity:
CID 1081083 (#1 of 1): Resource leak (RESOURCE_LEAK)
7. leaked_storage: Variable "array" going out of scope leaks the storage it points to

CID 1081082 (#1 of 1): Resource leak (RESOURCE_LEAK)
14. leaked_storage: Variable "matrix" going out of scope leaks the storage it points to.

Change-Id: Ib96e618c4239ec82d90f5822a1b5f5812d9067aa
  • Loading branch information
XiaoxiaoLiu committed Nov 6, 2013
1 parent 7f5ee55 commit 437e3c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Modules/IO/Meta/test/testMetaObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ int testMetaObject(int argc, char *argv[])
if(array[i] != i+1)
{
std::cout << "MyArray: FAIL" << std::endl;
delete[] array;
return EXIT_FAILURE;
}
}
Expand All @@ -112,6 +113,7 @@ int testMetaObject(int argc, char *argv[])
if(matrix[i] != i)
{
std::cout << "MyMatrix: FAIL" << std::endl;
delete[] matrix;
return EXIT_FAILURE;
}
}
Expand Down

0 comments on commit 437e3c7

Please sign in to comment.