]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntpd.c:
authorFrank Kardel <kardel@ntp.org>
Tue, 9 May 2006 07:12:14 +0000 (07:12 +0000)
committerFrank Kardel <kardel@ntp.org>
Tue, 9 May 2006 07:12:14 +0000 (07:12 +0000)
  move freerecvbuf() into block io section
  test receiver instead of just the rbuf pointer

bk: 446040ceim7Lat5qtCU9upkhrNJ9dw

ntpd/ntpd.c

index 2231614748ad0b42295030a801ee55fef7e35197..5ff0765b696911a5153bd8898a78ac29d7f2f1e4 100644 (file)
@@ -968,10 +968,9 @@ getgroup:
                         * Call the data procedure to handle each received
                         * packet.
                         */
-                       if (rbuf != NULL)       /* This should always be true */
+                       if (rbuf->receiver != NULL)     /* This should always be true */
                        {
                                (rbuf->receiver)(rbuf);
-                               freerecvbuf(rbuf);
                        } else {
                                 msyslog(LOG_ERR, "receive buffer corruption - receiver found to be NULL - ABORTING");
                                 abort();
@@ -979,6 +978,7 @@ getgroup:
 # ifdef HAVE_SIGNALED_IO
                         block_io_and_alarm();
 # endif /* HAVE_SIGNALED_IO */
+                       freerecvbuf(rbuf);
                }
 
                /*