curlx: simplify the curlx_unicodefree macro

- explain its purpose in a comment

Closes #17287
This commit is contained in:
Daniel Stenberg 2025-05-08 10:40:17 +02:00
parent 09fed29460
commit 1c6fc0cd2b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 8 deletions

View file

@ -81,12 +81,7 @@ typedef union {
#endif /* UNICODE && _WIN32 */
#define curlx_unicodefree(ptr) \
do { \
if(ptr) { \
(free)(CURL_UNCONST(ptr)); \
(ptr) = NULL; \
} \
} while(0)
/* the purpose of this macro is to free() without being traced by memdebug */
#define curlx_unicodefree(ptr) (free)(CURL_UNCONST(ptr))
#endif /* HEADER_CURL_MULTIBYTE_H */

View file

@ -3063,8 +3063,10 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
&used, global, config);
}
if(!result)
if(!result) {
unicodefree(orig_opt);
orig_opt = NULL;
}
}
if(!result && config->content_disposition) {