]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cw-out: unify the error handling pattern in cw_out_do_write
authorx2018 <xkernel.wang@foxmail.com>
Wed, 22 Oct 2025 11:07:57 +0000 (19:07 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 23 Oct 2025 06:17:55 +0000 (08:17 +0200)
to proper set the error status and release resource

Closes #19195

lib/cw-out.c

index 7a9274b5f21b61f332eff9dcd0b792f0c8c2e743..1f40316492673d1aa3bbd235eae0a125e467e7ab 100644 (file)
@@ -403,7 +403,7 @@ static CURLcode cw_out_do_write(struct cw_out_ctx *ctx,
     /* still have buffered data, append and flush */
     result = cw_out_append(ctx, data, otype, buf, blen);
     if(result)
-      return result;
+      goto out;
     result = cw_out_flush_chain(ctx, data, &ctx->buf, flush_all);
     if(result)
       goto out;