Skip to content

Commit 0781237

Browse files
committed
fix: release src_buf_view on TypeError
1 parent 4ec36c8 commit 0781237

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

dpctl/_sycl_queue.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ cdef DPCTLSyclEventRef _copy_memcpy_impl(
541541
c_dst_ptr = dst_buf_view.buf
542542
dst_is_buf = True
543543
else:
544+
if src_is_buf:
545+
PyBuffer_Release(&src_buf_view)
544546
raise TypeError(
545547
"Parameter `dst` should have either type `dpctl.memory._Memory` "
546548
"or a type that supports Python buffer protocol"

0 commit comments

Comments
 (0)