Skip to content

Instantly share code, notes, and snippets.

@bagder
Created May 17, 2026 21:32
Show Gist options
  • Select an option

  • Save bagder/92da4dd3b97196e0da91c4b9b52ea043 to your computer and use it in GitHub Desktop.

Select an option

Save bagder/92da4dd3b97196e0da91c4b9b52ea043 to your computer and use it in GitHub Desktop.
attempt to fix the torture test failure
diff --git a/src/tool_operate.c b/src/tool_operate.c
index f402c3f055..3e6038d9a6 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -854,10 +854,11 @@ static CURLcode post_close_output(struct per_transfer *per,
int rc;
/* Close the outs file */
if(outs->fopened && outs->stream) {
rc = curlx_fclose(outs->stream);
+ outs->stream = NULL;
if(!result && rc) {
/* something went wrong in the writing process */
result = CURLE_WRITE_ERROR;
errorf("curl: (%d) Failed writing body", result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment