mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Check if be is nil to avoid panic when be is overriden with nil by recoverSnapshotBackend on line 471
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
parent
2a07f80f77
commit
6723e3cc44
@ -341,7 +341,7 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) {
|
||||
be := openBackend(cfg)
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if be != nil && err != nil {
|
||||
be.Close()
|
||||
}
|
||||
}()
|
||||
|
Loading…
x
Reference in New Issue
Block a user