Skip to content

Commit e4792c8

Browse files
committed
Fix JsonDocument disposal in AgentPolicyEvaluator.ParsePolicy
Add missing `using` on JsonDocument.Parse to prevent resource leak. Found during adversarial self-review.
1 parent 2c7c1db commit e4792c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/src/Taskdeck.Application/Services/AgentPolicyEvaluator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ internal static AgentPolicyConfig ParsePolicy(string? policyJson)
126126

127127
try
128128
{
129-
var doc = JsonDocument.Parse(policyJson);
129+
using var doc = JsonDocument.Parse(policyJson);
130130
var root = doc.RootElement;
131131

132132
var allowedTools = new List<string>();

0 commit comments

Comments
 (0)