llvm/unittests: Use OwningPtr to fix --vg-leak.
[oota-llvm.git] / unittests / IR / ConstantsTest.cpp
index 5c739cd2177a06b4baf287289158e2657287d477..fee38b891de427b05d3327a635ff245ce6b36048 100644 (file)
@@ -162,7 +162,7 @@ TEST(ConstantsTest, PointerCast) {
   }
 
 TEST(ConstantsTest, AsInstructionsTest) {
-  Module *M = new Module("MyModule", getGlobalContext());
+  OwningPtr<Module> M(new Module("MyModule", getGlobalContext()));
 
   Type *Int64Ty = Type::getInt64Ty(getGlobalContext());
   Type *Int32Ty = Type::getInt32Ty(getGlobalContext());