Skip to content

Commit

Permalink
Merge pull request #1486 from ydb-platform/fix-panic
Browse files Browse the repository at this point in the history
* Fixed nil pointer dereference panic on failed `ydb.Open`
  • Loading branch information
rekby authored Sep 26, 2024
2 parents d6b0468 + e69f7ab commit 09ca0b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Added ip discovery. Server can show own ip address and target hostname in the ListEndpoint message. These fields are used to bypass DNS resolving.
* Fixed nil pointer dereference panic on failed `ydb.Open`
* Added ip discovery. Server can show own ip address and target hostname in the ListEndpoint message. These fields are used to bypass DNS resolving.

## v3.81.0
* Added error ErrMessagesPutToInternalQueueBeforeError to topic writer
Expand Down
4 changes: 3 additions & 1 deletion driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ func Open(ctx context.Context, dsn string, opts ...Option) (_ *Driver, _ error)
}()

if err = d.connect(ctx); err != nil {
_ = d.pool.Release(ctx)
if d.pool != nil {
_ = d.pool.Release(ctx)
}

return nil, xerrors.WithStackTrace(err)
}
Expand Down

0 comments on commit 09ca0b0

Please sign in to comment.