From: Harlan Stenn Date: Mon, 3 Mar 2014 08:37:29 +0000 (-0500) Subject: CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check X-Git-Tag: NTP_4_2_7P429~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdbbc97afe64a3006acff4533e10229f16618440;p=thirdparty%2Fntp.git CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check bk: 53143f49kwTYIXYJC5J2A5jAGy1fRw --- diff --git a/ChangeLog b/ChangeLog index ff526fa52..b31ceef4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ * CID 1165098: Remove logically dead code from refclock_true.c. +* CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check. * In ntp_dir_sep.m4, we care about $host_os, not $target_os. * [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups. * [Bug 2576] refclock_gpsdjson.c doesn't compile if CLOCK_GPSDJSON is diff --git a/ntpd/refclock_gpsdjson.c b/ntpd/refclock_gpsdjson.c index 659a6e81a..00aea62cf 100644 --- a/ntpd/refclock_gpsdjson.c +++ b/ntpd/refclock_gpsdjson.c @@ -264,10 +264,11 @@ gpsd_start( dev_fail: /* On failure, remove all UNIT ressources and declare defeat. */ - if (up) { - free(up->device); - free(up); - } + + INSIST (up); + free(up->device); + free(up); + pp->unitptr = (caddr_t)NULL; return FALSE; }