Commit 5ed7008
committed
Add NULL checks before snd_pcm_close() calls
Defensive programming to prevent undefined behavior when closing ALSA
PCM handles. While the previous commit disabled assertions with -DNDEBUG,
adding explicit NULL checks ensures graceful handling even if handles are
unexpectedly NULL.
All error paths that call snd_pcm_close() now verify the handle is non-NULL
before closing, preventing potential crashes in edge cases.1 parent fb6dbe5 commit 5ed7008
1 file changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
609 | 611 | | |
610 | 612 | | |
611 | 613 | | |
| |||
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
623 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
| |||
644 | 648 | | |
645 | 649 | | |
646 | 650 | | |
647 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
648 | 654 | | |
649 | 655 | | |
650 | 656 | | |
| |||
671 | 677 | | |
672 | 678 | | |
673 | 679 | | |
674 | | - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
675 | 683 | | |
676 | 684 | | |
677 | 685 | | |
| |||
888 | 896 | | |
889 | 897 | | |
890 | 898 | | |
891 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
892 | 902 | | |
893 | 903 | | |
894 | 904 | | |
| |||
903 | 913 | | |
904 | 914 | | |
905 | 915 | | |
906 | | - | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
907 | 919 | | |
908 | 920 | | |
909 | 921 | | |
| |||
0 commit comments