diff --git a/clock.c b/clock.c index beda1da..6eaa054 100644 --- a/clock.c +++ b/clock.c @@ -401,7 +401,7 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count, enum timestamp_type timestamping, struct defaultDS *ds, enum servo_type servo) { - int i, fadj = 0, max_adj, sw_ts = timestamping == TS_SOFTWARE ? 1 : 0; + int i, fadj = 0, max_adj = 0.0, sw_ts = timestamping == TS_SOFTWARE ? 1 : 0; struct clock *c = &the_clock; char phc[32]; struct interface udsif; diff --git a/config.c b/config.c index bfa00af..ef02880 100644 --- a/config.c +++ b/config.c @@ -341,6 +341,9 @@ int config_read(char *name, struct config *cfg) continue; } current_port = config_create_interface(port, cfg); + if (current_port < 0) { + return -1; + } } continue; } diff --git a/port.c b/port.c index fe7ece4..f2be7bc 100644 --- a/port.c +++ b/port.c @@ -1678,6 +1678,7 @@ struct port *port_open(int phc_index, pr_err("port %d: PHC device mismatch", number); pr_err("port %d: /dev/ptp%d requested, but /dev/ptp%d attached", number, phc_index, checked_phc_index); + free(p); return NULL; }