Skip to content

bindings/c: write may fail, but the error is silently ignored. #6125

@mzygQAQ

Description

@mzygQAQ
pub unsafe extern "C" fn opendal_writer_free(ptr: *mut opendal_writer) {
        if !ptr.is_null() {
            let _ = (*ptr).deref_mut().close();   // NOTE HERE: the error is ignored
            drop(Box::from_raw((*ptr).inner as *mut core::BlockingWriter));
            drop(Box::from_raw(ptr));
        }
    }

close the writer maybe failed, but the error is ignored.
The program may seem to succeed, but the write operation fails silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions