@@ -142,6 +142,7 @@ contains
142142 if (size(m1, 2) /= p(2)) then
143143 err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m1, m2 not of compatible sizes')
144144 call linalg_error_handling(err0, err)
145+ allocate(r(0, 0))
145146 return
146147 end if
147148
@@ -151,6 +152,7 @@ contains
151152 if (size(m3, 1) /= p(3)) then
152153 err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m2, m3 not of compatible sizes')
153154 call linalg_error_handling(err0, err)
155+ allocate(r(0, 0))
154156 return
155157 end if
156158
@@ -163,6 +165,7 @@ contains
163165 if (size(m4, 1) /= p(4)) then
164166 err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m3, m4 not of compatible sizes')
165167 call linalg_error_handling(err0, err)
168+ allocate(r(0, 0))
166169 return
167170 end if
168171
@@ -175,6 +178,7 @@ contains
175178 if (size(m5, 1) /= p(5)) then
176179 err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m4, m5 not of compatible sizes')
177180 call linalg_error_handling(err0, err)
181+ allocate(r(0, 0))
178182 return
179183 end if
180184
0 commit comments