Remove unfreed memory in quantize_test.cc
authorJohann <johannkoenig@google.com>
Tue, 25 Nov 2014 20:06:56 +0000 (12:06 -0800)
committerJohann <johannkoenig@google.com>
Tue, 25 Nov 2014 20:48:51 +0000 (12:48 -0800)
vp8_config doesn't need to be on the stack. Just use a local copy.

Change-Id: Ia241b1d87fd9422556d957f3ea43ad71eb5c414a

test/quantize_test.cc

index 329227b..53b36f3 100644 (file)
@@ -55,10 +55,10 @@ class QuantizeTestBase {
     rnd_.Reset(ACMRandom::DeterministicSeed());
 
     // The full configuration is necessary to generate the quantization tables.
-    VP8_CONFIG *const vp8_config =
-        reinterpret_cast<VP8_CONFIG *>(vpx_calloc(sizeof(*vp8_config), 1));
+    VP8_CONFIG vp8_config;
+    vpx_memset(&vp8_config, 0, sizeof(vp8_config));
 
-    vp8_comp_ = vp8_create_compressor(vp8_config);
+    vp8_comp_ = vp8_create_compressor(&vp8_config);
 
     // Set the tables based on a quantizer of 0.
     vp8_set_quantizer(vp8_comp_, 0);