This fixes valgrind warnings when running this test. The mismatched delete could also potentially have caused memory corruption issues while running the tests.
Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all
Unified · Split
| @@ -405,7 +405,7 @@ int SimulateNALLoss (const unsigned char* pSrc, int& iSrcLen, std::vector<SLost · 404 unmodified lines | ||
| 405 | 405 | memset ((void*)pSrc, 0, iSrcLen); |
| 406 | 406 | memcpy ((void*)pSrc, pDst, iDstLen); |
| 407 | 407 | iSrcLen = iDstLen; |
| 408 | − delete pDst; | |
| 408 | + delete [] pDst; | |
| 409 | 409 | return iSkipedBytes; |
| 410 | 410 | } |
| 411 | 411 | |