From 68e63a7997e33dd6393c60fe9157023c70b57fc3 Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 22 Oct 2025 13:24:55 +0800 Subject: [PATCH] curl_path: add curlx_dyn_free() on an error path Follow-up to 976333dd4052855c22369e89 Closes #19183 --- lib/vssh/curl_path.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vssh/curl_path.c b/lib/vssh/curl_path.c index 44ea3d07a5..a6d572520f 100644 --- a/lib/vssh/curl_path.c +++ b/lib/vssh/curl_path.c @@ -167,8 +167,10 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) /* Read to end of filename - either to whitespace or terminator */ rc = curlx_str_word(&cp, &word, MAX_PATHLENGTH); if(rc) { - if(rc == STRE_BIG) + if(rc == STRE_BIG) { + curlx_dyn_free(&out); return CURLE_TOO_LARGE; + } else if(!content) /* no path, no word, this is incorrect */ goto fail;