You could probably avoid this sort of thing by just calling MFCreateStreamDescriptor() inside of the if/else switch.
I decided against doing this in v2 of the patch, since it would require adding more cleanup code inside the branches; either through a second goto or copying heap_free to three failure paths.