Skip to content

Commit

Permalink
Add an assert to opts::set_opts.
Browse files Browse the repository at this point in the history
This function leaks if called more than once.
  • Loading branch information
brson committed May 9, 2015
1 parent 17747ad commit 8975a3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/util/opts.rs
Expand Up @@ -425,6 +425,7 @@ static mut OPTIONS: *mut Opts = 0 as *mut Opts;

pub fn set_opts(opts: Opts) {
unsafe {
assert!(OPTIONS.is_null());
let box_opts = box opts;
OPTIONS = mem::transmute(box_opts);
}
Expand Down

0 comments on commit 8975a3b

Please sign in to comment.