Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21565)
* increase our spare capacity.
*/
if (!TEST_true(net_sim_process(s, 0)))
- return 0;
+ goto err;
/* Do we have room for the packet in the network? */
success = (sz <= s->spare_capacity);
pkt->size = sz;
if (!TEST_true(s->ccm->on_data_sent(s->cc, sz)))
- return 0;
+ goto err;
if (!TEST_true(ossl_pqueue_NET_PKT_push(s->pkts, pkt, &pkt->idx)))
- return 0;
+ goto err;
return 1;
+
+err:
+ OPENSSL_free(pkt);
+ return 0;
}
static int net_sim_process_one(struct net_sim *s, int skip_forward)