From: x2018 Date: Wed, 22 Oct 2025 05:24:55 +0000 (+0800) Subject: curl_path: add curlx_dyn_free() on an error path X-Git-Tag: curl-8_17_0~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68e63a7997e33dd6393c60fe9157023c70b57fc3;p=thirdparty%2Fcurl.git curl_path: add curlx_dyn_free() on an error path Follow-up to 976333dd4052855c22369e89 Closes #19183 --- 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;