diff options
author | Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com> | 2019-09-04 14:04:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-04 14:04:47 -0700 |
commit | a454d295ed5383862fc10c1542805c780de86d9a (patch) | |
tree | b9a7838c3233c9a520281db2d7537870f282e702 | |
parent | b576cc6ce375cf42f6537d65a9ef29d67aa6b78e (diff) | |
parent | ba9af384942a46bc5341fe0c5330f9ca22bbde27 (diff) | |
download | platform_external_Microsoft-GSL-a454d295ed5383862fc10c1542805c780de86d9a.tar.gz platform_external_Microsoft-GSL-a454d295ed5383862fc10c1542805c780de86d9a.tar.bz2 platform_external_Microsoft-GSL-a454d295ed5383862fc10c1542805c780de86d9a.zip |
Merge pull request #803 from B1Z0N/master
Fixed memory leaks and out of bound access
-rw-r--r-- | tests/multi_span_tests.cpp | 4 | ||||
-rw-r--r-- | tests/notnull_tests.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/multi_span_tests.cpp b/tests/multi_span_tests.cpp index 7e3ec89..17188be 100644 --- a/tests/multi_span_tests.cpp +++ b/tests/multi_span_tests.cpp @@ -1220,6 +1220,8 @@ TEST_CASE("md_access") expected += 3; } } + + delete[] image_ptr; } GSL_SUPPRESS(con.4) // NO-FORMAT: attribute @@ -1616,6 +1618,8 @@ TEST_CASE("span_structure_size") multi_span<const double, dynamic_range, 6, 4> av2 = as_multi_span(av1, dim(5), dim<6>(), dim<4>()); (void) av2; + + delete[] arr; } GSL_SUPPRESS(con.4) // NO-FORMAT: attribute diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp index ce5a123..010dd00 100644 --- a/tests/notnull_tests.cpp +++ b/tests/notnull_tests.cpp @@ -234,8 +234,8 @@ void ostream_helper(T v) { std::ostringstream os; std::ostringstream ref; - os << p; - ref << &v; + os << static_cast<void*>(p); + ref << static_cast<void*>(&v); CHECK(os.str() == ref.str()); } { |