]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream: do not try to free a failed stream-conn
authorWilly Tarreau <w@1wt.eu>
Mon, 20 Mar 2023 18:11:08 +0000 (19:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 Mar 2023 18:58:38 +0000 (19:58 +0100)
In stream_free() if we fail to allocate s->scb() we go to the path where
we try to free it, and it doesn't like being called with a null at all.
It's easily reproducible with -dMfail,no-cache and "tune.fail-alloc 10"
in the global section.

This must be backported to 2.6.

src/stream.c

index b2428e4a74964db141778aa57c37890d7aa00cad..d37cefab88905050bf93f9c67e8f83ae557f1568 100644 (file)
@@ -582,8 +582,8 @@ struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer
  out_fail_accept:
        flt_stream_release(s, 0);
        LIST_DELETE(&s->list);
- out_fail_alloc_scb:
        sc_free(s->scb);
+ out_fail_alloc_scb:
  out_fail_attach_scf:
        task_destroy(t);
  out_fail_alloc: