Fix panic with no output file provided
@@ -27,7 +27,6 @@ type Runner struct {
// output is the output file to write if any
output *bufwriter.Writer
- outputMutex *sync.Mutex
tempFile string
templatesConfig *nucleiConfig
@@ -46,7 +45,6 @@ type Runner struct {
// New creates a new client for running enumeration process.
func New(options *Options) (*Runner, error) {
runner := &Runner{
- outputMutex: &sync.Mutex{},
options: options,
}
@@ -170,7 +168,9 @@ func New(options *Options) (*Runner, error) {
// Close releases all the resources and cleans up
func (r *Runner) Close() {
+ if r.output != nil {
r.output.Close()
+ }
os.Remove(r.tempFile)
}
