[Bro-Dev] [Bro-Commits] [git/bro] fastpath: Fixed a couple of init-time mem leaks. (750e1dd)

Siwek, Jonathan Luke jsiwek at illinois.edu
Mon Jul 16 13:22:00 PDT 2012


> diff --git a/src/scan.l b/src/scan.l
> index 645ce65..d90501d 100644
> --- a/src/scan.l
> +++ b/src/scan.l
> @@ -776,7 +776,7 @@ void add_input_file(const char* file)
> 	if ( ! filename )
> 		(void) load_files(file);
> 	else
> -		input_files.append(copy_string(file));
> +		input_files.append((char*) file);
> 	}

Not sure that's going to work right: one call in scan.l gives as input the c_str() from an automatic std::string that goes out of scope soon afterwards, so it's relying on that copy to happen.

Maybe a better thing would be to change input_files to use standard container types (e.g. vector of string or something).

    Jon


More information about the bro-dev mailing list