Skip to content
Snippets Groups Projects
Commit f9f1a16a authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

fclose() newfile before renaming.

Thanks Microsoft!
parent a839a6f0
No related branches found
No related tags found
No related merge requests found
Pipeline #8110 passed
...@@ -1062,6 +1062,8 @@ do_request(struct http_session *sess) ...@@ -1062,6 +1062,8 @@ do_request(struct http_session *sess)
ret = read_body(sess, newfile); ret = read_body(sess, newfile);
if (!ret) if (!ret)
goto error_return; goto error_return;
fclose(newfile);
newfile = NULL;
if (rename(npath, path) != 0) { if (rename(npath, path) != 0) {
set_msg(sess->req, "rename(npath, path) error"); set_msg(sess->req, "rename(npath, path) error");
goto error_return; goto error_return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment