X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fntpd.c;h=33acc69fe1b0631d28f65e49a4144d111d77be7d;hb=b5b5d43f302e0b9290d3e247ea29699814d46abb;hp=1ee91e698f308ed80861e2dc6269ec3ebf505237;hpb=09b119f3438d083575ab45f49ac58bb8268a61e0;p=collectd.git diff --git a/src/ntpd.c b/src/ntpd.c index 1ee91e69..33acc69f 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -29,8 +29,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #if HAVE_NETDB_H #include @@ -251,7 +251,7 @@ static const char *refclock_names[] = { "CHRONOLOG", "DUMBCLOCK", "ULINK_M320", "PCF", /* 32-35 */ "WWV_AUDIO", "GPS_FG", "HOPF_S", "HOPF_P", /* 36-39 */ "JJY", "TT_IRIG", "GPS_ZYFER", "GPS_RIPENCC", /* 40-43 */ - "NEOCLK4X" /* 44 */ + "NEOCLK4X", "PCI_TSYNC", "GPSD_JSON" /* 44-46 */ }; static size_t refclock_names_num = STATIC_ARRAY_SIZE(refclock_names); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -810,11 +810,13 @@ static int ntpd_read(void) { if (status != 0) { ERROR("ntpd plugin: ntpd_do_query (REQ_GET_KERNEL) failed with status %i", status); + free(ik); return status; } else if ((ik == NULL) || (ik_num == 0) || (ik_size == 0)) { ERROR("ntpd plugin: ntpd_do_query returned unexpected data. " "(ik = %p; ik_num = %i; ik_size = %i)", (void *)ik, ik_num, ik_size); + free(ik); return -1; } @@ -849,11 +851,13 @@ static int ntpd_read(void) { ERROR( "ntpd plugin: ntpd_do_query (REQ_PEER_LIST_SUM) failed with status %i", status); + free(ps); return status; } else if ((ps == NULL) || (ps_num == 0) || (ps_size == 0)) { ERROR("ntpd plugin: ntpd_do_query returned unexpected data. " "(ps = %p; ps_num = %i; ps_size = %i)", (void *)ps, ps_num, ps_size); + free(ps); return -1; }