Skip to content

Leaking cookiejar temp file in some error code paths #19267

Description

@piru

I did this

Quickly review code handling temporary files and get renamed to final output files.

I expected the following

The code not to leak files on error code paths.

In particular this is the only location that unlinks the temporary file (tempstore) on error:

curl/lib/cookie.c

Line 1598 in fa49c50

unlink(tempstore);

I think would be smarter to remove this line and move the unlink to error: section by adding:

if(tempstore)
  unlink(tempstore);

I would have normally just PRd this but I'm a bit too busy atm.

curl/libcurl version

master

operating system

all

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions