]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Cleanup leaked context information on failure
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 5 Dec 2017 00:03:51 +0000 (19:03 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 5 Dec 2017 00:03:51 +0000 (19:03 -0500)
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 <sharpd@cumulusnetworks.com>
zebra/zebra_ptm.c

index dcd4fb02398ac647d7a4357bf78d22fbc1df5a9f..769d2f566619a1dce2690187241aae1691be4ed9 100644 (file)
@@ -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;
 }