[PATCH] D26347: Fix memory leaks (coverity issues 1365586 & 1365591)

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 14:22:44 PST 2016


george.burgess.iv added a comment.

Thanks for working on this! Just one drive-by nit.



================
Comment at: lib/Support/APFloat.cpp:1685
   int parts = partCount();
   integerPart *x = new integerPart[parts];
   bool ignored;
----------------
malcolm.parsons wrote:
> Why not use std::unique_ptr?
Piggybacking off of this, it looks like x is always deleted, so would it be correct/beneficial to use a `SmallVector<integerPart, N>` instead of an array that we always heap-allocate?


Repository:
  rL LLVM

https://reviews.llvm.org/D26347





More information about the llvm-commits mailing list