OpenCoreUefiAudio: Fix another potential assertion in audio code
@@ -374,10 +374,16 @@ OcLoadUefiAudioSupport (
}
}
+ //
+ // NULL DevicePath means choose the first audio device available on the platform.
+ //
+
OcAudio = OcAudioInstallProtocols (FALSE);
if (OcAudio == NULL) {
DEBUG ((DEBUG_INFO, "OC: Cannot locate OcAudio protocol\n"));
+ if (DevicePath != NULL) {
FreePool (DevicePath);
+ }
return;
}
