diff --git a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red_unittest.cc b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red_unittest.cc index 92f748ce8..b26273479 100644 --- a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red_unittest.cc +++ b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red_unittest.cc @@ -308,14 +308,14 @@ TEST_F(AudioEncoderCopyRedDeathTest, WrongFrameSize) { EXPECT_DEATH(Encode(), ""); } -// Test fails memcheck. -// https://code.google.com/p/webrtc/issues/detail?id=4108 -TEST_F(AudioEncoderCopyRedDeathTest, DISABLED_NullSpeechEncoder) { - AudioEncoderCopyRed* red; +TEST_F(AudioEncoderCopyRedDeathTest, NullSpeechEncoder) { + AudioEncoderCopyRed* red = NULL; AudioEncoderCopyRed::Config config; config.speech_encoder = NULL; EXPECT_DEATH(red = new AudioEncoderCopyRed(config), "Speech encoder not provided."); + // The delete operation is needed to avoid leak reports from memcheck. + delete red; } #endif // GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)