Skip to content

Commit e6de596

Browse files
committed
Release endpoint if SarProcessPendingEndpoints fails.
1 parent 6b65191 commit e6de596

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: SynchronousAudioRouter/control.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ VOID SarProcessPendingEndpoints(PDEVICE_OBJECT deviceObject, PVOID context)
458458
PUNICODE_STRING symlink =
459459
KsFilterFactoryGetSymbolicLink(endpoint->filterFactory);
460460
PLIST_ENTRY current = entry;
461+
PIRP pendingIrp = endpoint->pendingIrp;
461462

462463
entry = endpoint->listEntry.Flink;
463464
RemoveEntryList(current);
@@ -499,11 +500,11 @@ VOID SarProcessPendingEndpoints(PDEVICE_OBJECT deviceObject, PVOID context)
499500
if (NT_SUCCESS(status)) {
500501
InsertTailList(&controlContext->endpointList, &endpoint->listEntry);
501502
} else {
502-
// TODO: delete failed endpoint
503+
SarReleaseEndpoint(endpoint);
503504
}
504505

505-
endpoint->pendingIrp->IoStatus.Status = status;
506-
IoCompleteRequest(endpoint->pendingIrp, IO_NO_INCREMENT);
506+
pendingIrp->IoStatus.Status = status;
507+
IoCompleteRequest(pendingIrp, IO_NO_INCREMENT);
507508
}
508509

509510
// Someone added a new endpoint request while we were working with locks

0 commit comments

Comments
 (0)