]> git.ipfire.org Git - thirdparty/curl.git/commit
fopen: allocate the dir after fopen
authorDaniel Stenberg <daniel@haxx.se>
Fri, 24 Nov 2023 08:46:32 +0000 (09:46 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Nov 2023 12:24:08 +0000 (13:24 +0100)
commitf27b8dba73295cb5296a50f2c19c0739b502eb94
treefd7d2cce735acfea8304943a284c5141ce4541a0
parent5b65e7d1aed1770c84f9a179dbf96591ea149f46
fopen: allocate the dir after fopen

Move the allocation of the directory name down to after the fopen() call
to allow that shortcut code path to avoid a superfluous malloc+free
cycle.

Follow-up to 73b65e94f35311

Closes #12398
lib/fopen.c