Skip to content

Commit

Permalink
fixing a memory leak when converting the xml to a string
Browse files Browse the repository at this point in the history
  • Loading branch information
scooterman authored and dginev committed Apr 17, 2022
1 parent 2c336dd commit e7e1170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tree/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl Document {

let save_ctx = xmlSaveToBuffer(buf, c_utf8.as_ptr(), xml_options as i32);
let _size = xmlSaveDoc(save_ctx, self.doc_ptr());
let _size = xmlSaveFlush(save_ctx);
let _size = xmlSaveClose(save_ctx);

let result = xmlBufferContent(buf);
let c_string = CStr::from_ptr(result as *const c_char);
Expand Down

0 comments on commit e7e1170

Please sign in to comment.