From a8e725f8002ae5fd5309b8539945d6bbe269c2a1 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 8 May 2012 16:47:12 -0700 Subject: [PATCH] enc/vp8l: fix double free on error GetHuffBitLengthsAndCodes and the caller would both free bit_lengths/bit_codes Change-Id: I1b62ff727c82567f11c39a847f74fe765b5f527c --- src/enc/vp8l.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/enc/vp8l.c b/src/enc/vp8l.c index c76f132d..bf645fbc 100644 --- a/src/enc/vp8l.c +++ b/src/enc/vp8l.c @@ -338,6 +338,8 @@ static int GetHuffBitLengthsAndCodes( for (idx = 0; idx <= 5 * i + k; ++idx) { free(bit_lengths[idx]); free(bit_codes[idx]); + bit_lengths[idx] = NULL; + bit_codes[idx] = NULL; } } return 0;