]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 709185: refclock_chu.c will leak fd==0 (which should be impossible)
authorHarlan Stenn <stenn@ntp.org>
Sun, 15 Jul 2012 06:46:24 +0000 (23:46 -0700)
committerHarlan Stenn <stenn@ntp.org>
Sun, 15 Jul 2012 06:46:24 +0000 (23:46 -0700)
bk: 50026740AlMejDWW-NVg9WVWs6frbw

ChangeLog
ntpd/refclock_chu.c

index 9f1d15fe62672df69a2c51c59fdae31be786d2ba..ba090da6b9a8ee005ab9f2aeb6c3ffacabf75663 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* CID 709185: refclock_chu.c will leak fd==0 (which should be impossible).
 (4.2.7p288) 2012/07/03 Released by Harlan Stenn <stenn@ntp.org>
 * CID 709173: Make sure a libisc function we do not use is called properly.
 (4.2.7p287) 2012/07/03 Released by Harlan Stenn <stenn@ntp.org>
index fd9513afab8ed67953fda3467f01d297da967426..48b67536fb9410a8daa832cc17a113d9389ed730 100644 (file)
@@ -480,6 +480,17 @@ chu_start(
         * Open audio device. Don't complain if not there.
         */
        fd_audio = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
+
+       /*
+       ** refclock_irig.c and refclock_wwv.c call audio_init() too,
+       ** but they tolerate fd == 0.
+       **
+       ** This code will leak a file descriptor if it is 0.
+       **
+       ** For now...
+       */
+       INSIST(0 != fd_audio);  /* Coverity 709185 */
+
 #ifdef DEBUG
        if (fd_audio > 0 && debug)
                audio_show();