In port_management_fill_response() the TLV descriptor leaked when
not responding.

In port_open() the port would leak with the unsupported management clock
type.

Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 port.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/port.c b/port.c
index 6f5408e..5e0aed7 100644
--- a/port.c
+++ b/port.c
@@ -914,6 +914,7 @@ static int port_management_fill_response(struct port 
*target,
                break;
        default:
                /* The caller should *not* respond to this message. */
+               tlv_extra_recycle(extra);
                return 0;
        }
 
@@ -2844,7 +2845,7 @@ struct port *port_open(int phc_index,
                p->event = e2e_event;
                break;
        case CLOCK_TYPE_MANAGEMENT:
-               return NULL;
+               goto err_port;
        }
 
        p->state_machine = clock_slave_only(clock) ? ptp_slave_fsm : ptp_fsm;
-- 
2.17.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to