Fix a leak in PDF_DataDecode() on failure.
authorLei Zhang <thestig@chromium.org>
Fri, 2 Oct 2015 17:56:30 +0000 (10:56 -0700)
committerLei Zhang <thestig@chromium.org>
Fri, 2 Oct 2015 17:56:30 +0000 (10:56 -0700)
Found using the test examples from https://crbug.com/537780

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1376413003 .

core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp

index 402a19e..2d6e9f3 100644 (file)
@@ -416,6 +416,7 @@ FX_BOOL PDF_DataDecode(const uint8_t* src_buf,
       FX_Free(last_buf);
     }
     if (offset == -1) {
+      FX_Free(new_buf);
       return FALSE;
     }
     last_buf = new_buf;