Skip to content

Commit 13215d6

Browse files
committed
fix leaked files
1 parent f3cff03 commit 13215d6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coderd/parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (api *API) handleDynamicParameters(rw http.ResponseWriter, r *http.Request,
120120

121121
if tf.CachedModuleFiles.Valid {
122122
moduleFilesFS, err := api.FileCache.Acquire(fileCtx, tf.CachedModuleFiles.UUID)
123-
defer api.FileCache.Release(fileID)
123+
defer api.FileCache.Release(tf.CachedModuleFiles.UUID)
124124
if err != nil {
125125
httpapi.Write(ctx, rw, http.StatusNotFound, codersdk.Response{
126126
Message: "Internal error fetching Terraform modules.",

codersdk/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func (c *Client) Dial(ctx context.Context, path string, opts *websocket.DialOpti
359359
}
360360

361361
conn, resp, err := websocket.Dial(ctx, u.String(), opts)
362-
if resp.Body != nil {
362+
if resp != nil && resp.Body != nil {
363363
resp.Body.Close()
364364
}
365365
if err != nil {

0 commit comments

Comments
 (0)