Skip to content
Permalink
Browse files

Add an assert to opts::set_opts.

This function leaks if called more than once.
  • Loading branch information
brson committed May 9, 2015
1 parent 17747ad commit 8975a3bd9b67a3a54196943ab975fda4b53d57fe
Showing with 1 addition and 0 deletions.
  1. +1 −0 components/util/opts.rs
@@ -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);
}

0 comments on commit 8975a3b

Please sign in to comment.
You can’t perform that action at this time.