Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary files never closed #2

Open
MaxInertia opened this issue Nov 13, 2019 · 0 comments
Open

Temporary files never closed #2

MaxInertia opened this issue Nov 13, 2019 · 0 comments
Assignees

Comments

@MaxInertia
Copy link

The function addFile in middleware.go creates, opens and writes to temporary files but doesn't close them. This might cause problems with long running applications.

Starting at line 194

f, err := ioutil.TempFile(os.TempDir(), fmt.Sprintf("graphql-upload-%s%s", handle.Filename, filepath.Ext(handle.Filename)))
if err != nil {
	return nil, fmt.Errorf("unable to create temp file. reason: %v", err)
}

should have defer f.Close() after the error check

@smithaitufe smithaitufe self-assigned this Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants