Commit c11cd5b
authored
Fix memory leaks in addCapability and addConditionalCapability (#3403)
Compiling with `-fsanitize=address` uncovered 2 memory leaks related to
the use of raw pointers in `addCapability` and
`addConditionalCapability`.
Instead of manually handling memory, use `std::unique_ptr` to track the
ownership of the pointed object and free the memory for us.1 parent 57c254d commit c11cd5b
File tree
3 files changed
+18
-19
lines changed- lib/SPIRV/libSPIRV
3 files changed
+18
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | 668 | | |
675 | 669 | | |
676 | 670 | | |
| |||
789 | 783 | | |
790 | 784 | | |
791 | 785 | | |
792 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
793 | 789 | | |
794 | 790 | | |
795 | | - | |
| 791 | + | |
796 | 792 | | |
797 | 793 | | |
798 | 794 | | |
| |||
801 | 797 | | |
802 | 798 | | |
803 | 799 | | |
804 | | - | |
| 800 | + | |
805 | 801 | | |
806 | 802 | | |
807 | 803 | | |
808 | 804 | | |
809 | | - | |
| 805 | + | |
| 806 | + | |
810 | 807 | | |
811 | 808 | | |
812 | | - | |
| 809 | + | |
813 | 810 | | |
814 | 811 | | |
815 | 812 | | |
| |||
818 | 815 | | |
819 | 816 | | |
820 | 817 | | |
821 | | - | |
822 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
823 | 821 | | |
824 | 822 | | |
825 | 823 | | |
826 | | - | |
| 824 | + | |
| 825 | + | |
827 | 826 | | |
828 | 827 | | |
829 | 828 | | |
830 | 829 | | |
831 | | - | |
832 | | - | |
| 830 | + | |
833 | 831 | | |
834 | 832 | | |
835 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
0 commit comments