Skip to content

Commit d43af6a

Browse files
committed
gio: Don't wrongly cast DataInputStream byte arrays to a const pointer
They're transfer full and need to be freed, which wouldn't be possible for a const pointer. Fixes #1237
1 parent a0d5234 commit d43af6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gio/src/data_input_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
220220
if error.is_null() {
221221
let length = length.assume_init();
222222
Ok(FromGlibContainer::from_glib_full_num(
223-
ret as *const _,
223+
ret as *mut u8,
224224
length,
225225
))
226226
} else {
@@ -268,7 +268,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
268268
let result = if error.is_null() {
269269
let length = length.assume_init();
270270
Ok(FromGlibContainer::from_glib_full_num(
271-
ret as *const _,
271+
ret as *mut u8,
272272
length,
273273
))
274274
} else {

0 commit comments

Comments
 (0)