ha_alert("out of memory in dns_session_create().\n");
goto out_free_appctx;
}
+ appctx->sess = sess;
if (!sockaddr_alloc(&addr, &ds->dss->srv->addr, sizeof(ds->dss->srv->addr)))
- goto out_free_sess;
+ goto out_free_appctx;
cs = cs_new_from_endp(appctx->endp, sess, &BUF_NULL);
if (!cs) {
/* Error unrolling */
out_free_addr:
sockaddr_free(&addr);
- out_free_sess:
- session_free(sess);
out_free_appctx:
appctx_free(appctx);
out_close:
if (!sess)
goto out_free_spoe;
+ appctx->sess = sess;
cs = cs_new_from_endp(appctx->endp, sess, &BUF_NULL);
if (!cs)
- goto out_free_sess;
+ goto out_free_spoe;
strm = DISGUISE(cs_strm(cs));
stream_set_backend(strm, conf->agent->b.be);
return appctx;
/* Error unrolling */
- out_free_sess:
- session_free(sess);
out_free_spoe:
task_destroy(SPOE_APPCTX(appctx)->task);
out_free_spoe_appctx:
goto out_fail_appctx;
}
+ appctx->sess = sess;
cs = cs_new_from_endp(appctx->endp, sess, &BUF_NULL);
if (!cs) {
hlua_pusherror(L, "socket: out of memory");
- goto out_fail_sess;
+ goto out_fail_appctx;
}
s = DISGUISE(cs_strm(cs));
return 1;
- out_fail_sess:
- session_free(sess);
out_fail_appctx:
appctx_free(appctx);
out_fail_conf:
ha_alert("httpclient: out of memory in %s:%d.\n", __FUNCTION__, __LINE__);
goto out_free_appctx;
}
+ appctx->sess = sess;
/* choose the SSL server or not */
switch (scheme) {
target = &httpclient_srv_ssl->obj_type;
} else {
ha_alert("httpclient: SSL was disabled (wrong verify/ca-file)!\n");
- goto out_free_sess;
+ goto out_free_appctx;
}
#else
ha_alert("httpclient: OpenSSL is not available %s:%d.\n", __FUNCTION__, __LINE__);
- goto out_free_sess;
+ goto out_free_appctx;
#endif
break;
}
if (!ss_dst) {
ha_alert("httpclient: Failed to initialize address %s:%d.\n", __FUNCTION__, __LINE__);
- goto out_free_sess;
+ goto out_free_appctx;
}
if (!sockaddr_alloc(&addr, ss_dst, sizeof(*ss_dst)))
- goto out_free_sess;
+ goto out_free_appctx;
cs = cs_new_from_endp(appctx->endp, sess, &hc->req.buf);
if (!cs) {
out_free_addr:
sockaddr_free(&addr);
-out_free_sess:
- session_free(sess);
out_free_appctx:
appctx_free(appctx);
out:
ha_alert("out of memory in peer_session_create().\n");
goto out_free_appctx;
}
+ appctx->sess = sess;
if (!sockaddr_alloc(&addr, &peer->addr, sizeof(peer->addr)))
- goto out_free_sess;
+ goto out_free_appctx;
cs = cs_new_from_endp(appctx->endp, sess, &BUF_NULL);
if (!cs) {
ha_alert("Failed to initialize stream in peer_session_create().\n");
- goto out_free_addr;
+ goto out_free_appctx;
}
s = DISGUISE(cs_strm(cs));
/* Error unrolling */
out_free_addr:
sockaddr_free(&addr);
- out_free_sess:
- session_free(sess);
out_free_appctx:
appctx_free(appctx);
out_close:
ha_alert("out of memory in sink_forward_session_create().\n");
goto out_free_appctx;
}
+ appctx->sess = sess;
if (!sockaddr_alloc(&addr, &sft->srv->addr, sizeof(sft->srv->addr)))
- goto out_free_sess;
+ goto out_free_appctx;
cs = cs_new_from_endp(appctx->endp, sess, &BUF_NULL);
if (!cs) {
ha_alert("Failed to initialize stream in sink_forward_session_create().\n");
- goto out_free_addr;
+ goto out_free_appctx;
}
s = DISGUISE(cs_strm(cs));
/* Error unrolling */
out_free_addr:
sockaddr_free(&addr);
- out_free_sess:
- session_free(sess);
out_free_appctx:
appctx_free(appctx);
out_close:
struct session *sess = strm_sess(s);
struct proxy *fe = sess->fe;
struct bref *bref, *back;
- int must_free_sess;
int i;
DBG_TRACE_POINT(STRM_EV_STRM_FREE, s);
}
LIST_DELETE(&s->list);
- /* applets do not release session yet */
- /* FIXME: Handle it in appctx_free ??? */
- must_free_sess = objt_appctx(sess->origin) && sess->origin == __cs_endp_target(s->csf);
-
cs_destroy(s->csb);
cs_destroy(s->csf);
- if (must_free_sess) {
- sess->origin = NULL;
- session_free(sess);
- }
-
pool_free(pool_head_stream, s);
/* We may want to free the maximum amount of pools if the proxy is stopping */