]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check
authorHarlan Stenn <stenn@ntp.org>
Mon, 3 Mar 2014 08:37:29 +0000 (03:37 -0500)
committerHarlan Stenn <stenn@ntp.org>
Mon, 3 Mar 2014 08:37:29 +0000 (03:37 -0500)
bk: 53143f49kwTYIXYJC5J2A5jAGy1fRw

ChangeLog
ntpd/refclock_gpsdjson.c

index ff526fa520c198e74644e8dc604d3ce0469804f1..b31ceef4b58ee4fcd5adc9e73b9b8b9a0121de92 100644 (file)
--- 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
index 659a6e81a7aad43928592fb3583bee8eea40e63a..00aea62cf675725b463fbec5e9f7180475651da6 100644 (file)
@@ -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;
 }