session BUGFIX memory leak for starting client sessions
Fixes cesnet/netopeer2#712
@@ -628,7 +628,7 @@ nc_session_free(struct nc_session *session, void (*data_free)(void *))
} /* else failed to lock it, too bad */
}
- if ((session->side == NC_CLIENT) && (session->status == NC_STATUS_RUNNING)) {
+ if (session->side == NC_CLIENT) {
/* cleanup message queues */
/* notifications */
for (contiter = session->opts.client.notifs; contiter; ) {
@@ -648,6 +648,7 @@ nc_session_free(struct nc_session *session, void (*data_free)(void *))
free(p);
}
+ if (session->status == NC_STATUS_RUNNING) {
/* send closing info to the other side */
ietfnc = ly_ctx_get_module(session->ctx, "ietf-netconf", NULL, 1);
if (!ietfnc) {
@@ -679,6 +680,7 @@ nc_session_free(struct nc_session *session, void (*data_free)(void *))
break;
}
}
+ }
/* list of server's capabilities */
if (session->opts.client.cpblts) {
