Skip to content

Commit

Permalink
cmd/dlv: logger is not closed in connect command (#3367)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed May 15, 2023
1 parent 674bd63 commit 1c9792b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/dlv/cmds/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,16 +818,18 @@ func connectCmd(cmd *cobra.Command, args []string) {
os.Exit(1)
return
}
defer logflags.Close()
if loadConfErr != nil {
logflags.DebuggerLogger().Errorf("%v", loadConfErr)
}
addr := args[0]
if addr == "" {
fmt.Fprint(os.Stderr, "An empty address was provided. You must provide an address as the first argument.\n")
logflags.Close()
os.Exit(1)
}
os.Exit(connect(addr, nil, conf, debugger.ExecutingOther))
ec := connect(addr, nil, conf, debugger.ExecutingOther)
logflags.Close()
os.Exit(ec)
}

// waitForDisconnectSignal is a blocking function that waits for either
Expand Down

0 comments on commit 1c9792b

Please sign in to comment.