Skip to content

Commit

Permalink
Merge pull request #471 from rouault/fix_read_dir_memleak
Browse files Browse the repository at this point in the history
_read_dir(): fix memory leak
  • Loading branch information
lnicola authored Nov 30, 2023
2 parents 203486d + e8cec95 commit ed03cea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vsi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub fn read_dir<P: AsRef<Path>>(path: P, recursive: bool) -> Result<Vec<PathBuf>
data
};

Ok(_pathbuf_array(data))
let ret = Ok(_pathbuf_array(data));
unsafe { gdal_sys::CSLDestroy(data) };
ret
}
_read_dir(path.as_ref(), recursive)
}
Expand Down

0 comments on commit ed03cea

Please sign in to comment.