diff --git a/dial.go b/dial.go
index 7c959bff04b105c1c7ad0be0b2a3671d3ad01533..a79b55e6f8c963e07c7131a0c103f18d7fc18e88 100644
--- a/dial.go
+++ b/dial.go
@@ -250,7 +250,8 @@ func verifyServerExtensions(copts *compressionOptions, h http.Header) (*compress
 		return nil, fmt.Errorf("WebSocket protcol violation: unsupported extensions from server: %+v", exts[1:])
 	}
 
-	copts = &*copts
+	_copts := *copts
+	copts = &_copts
 
 	for _, p := range ext.params {
 		switch p {
diff --git a/internal/test/wstest/pipe.go b/internal/test/wstest/pipe.go
index 1534f3168153134fa1cb3d178cdb964174e95441..f3d4c517f4a673e3b9350b54af687361f7444e84 100644
--- a/internal/test/wstest/pipe.go
+++ b/internal/test/wstest/pipe.go
@@ -24,7 +24,8 @@ func Pipe(dialOpts *websocket.DialOptions, acceptOpts *websocket.AcceptOptions)
 	if dialOpts == nil {
 		dialOpts = &websocket.DialOptions{}
 	}
-	dialOpts = &*dialOpts
+	_dialOpts := *dialOpts
+	dialOpts = &_dialOpts
 	dialOpts.HTTPClient = &http.Client{
 		Transport: tt,
 	}