Fix memory leak.
authorKevin Lim <ktlim@umich.edu>
Mon, 12 Jun 2006 22:58:29 +0000 (18:58 -0400)
committerKevin Lim <ktlim@umich.edu>
Mon, 12 Jun 2006 22:58:29 +0000 (18:58 -0400)
src/arch/alpha/ev5.cc:
    Fix memory leak.  The faults are refcounted, but that only works if you're actually assigning them to a RefCountingPtr.

--HG--
extra : convert_revision : 9a57963eb5d5d86c16023bfedb0fb5ccdbe7efaa

src/arch/alpha/ev5.cc

index c419762b757fb063f673182ad4d85a7171081151..247c5f56e651da50ab34b2e433726854f91a43ba 100644 (file)
@@ -59,8 +59,12 @@ AlphaISA::initCPU(ThreadContext *tc, int cpuId)
     tc->setIntReg(16, cpuId);
     tc->setIntReg(0, cpuId);
 
-    tc->setPC(tc->readMiscReg(IPR_PAL_BASE) + (new ResetFault)->vect());
+    AlphaFault *reset = new ResetFault;
+
+    tc->setPC(tc->readMiscReg(IPR_PAL_BASE) + reset->vect());
     tc->setNextPC(tc->readPC() + sizeof(MachInst));
+
+    delete reset;
 }
 
 ////////////////////////////////////////////////////////////////////////