From: Donald Sharp Date: Tue, 5 Dec 2017 00:03:51 +0000 (-0500) Subject: zebra: Cleanup leaked context information on failure X-Git-Tag: frr-4.0-dev~107^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a928d46462f10284cdc2da06bf6f3eb8eec7ce05;p=matthieu%2Ffrr.git zebra: Cleanup leaked context information on failure When we get a STREAM_GET failure of some sort we need to handle the failure case here and safely free up stored memory/context and return gracefully. Signed-off-by: Donald Sharp --- diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index dcd4fb0239..769d2f5666 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -817,6 +817,7 @@ int zebra_ptm_bfd_dst_register(struct zserv *client, u_short length, zebra_ptm_send_message(ptm_cb.out_data, data_len); stream_failure: + ptm_lib_cleanup_msg(ptm_hdl, out_ctxt); return 0; } @@ -946,6 +947,7 @@ int zebra_ptm_bfd_dst_deregister(struct zserv *client, u_short length, zebra_ptm_send_message(ptm_cb.out_data, data_len); stream_failure: + ptm_lib_cleanup_msg(ptm_hdl, out_ctxt); return 0; }