DbgBreakpoint: fix memory leak

This commit is contained in:
Max Kellermann 2020-02-19 10:22:51 +01:00
parent 37e7e914dc
commit 19fd51a35b

View file

@ -260,6 +260,7 @@ BreakCode DbgBreakpoint::HasHit()
if ( ! IsIntegral(yes->Type()->Tag()) && if ( ! IsIntegral(yes->Type()->Tag()) &&
! IsBool(yes->Type()->Tag()) ) ! IsBool(yes->Type()->Tag()) )
{ {
Unref(yes);
PrintHitMsg(); PrintHitMsg();
debug_msg("Breakpoint condition should return an integral type"); debug_msg("Breakpoint condition should return an integral type");
return bcHitAndDelete; return bcHitAndDelete;
@ -267,7 +268,12 @@ BreakCode DbgBreakpoint::HasHit()
yes->CoerceToInt(); yes->CoerceToInt();
if ( yes->IsZero() ) if ( yes->IsZero() )
{
Unref(yes);
return bcNoHit; return bcNoHit;
}
Unref(yes);
} }
int repcount = GetRepeatCount(); int repcount = GetRepeatCount();