Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/mpl/dhcp/dist/common dhcpd: move isc_event_free() b...



details:   https://anonhg.NetBSD.org/src/rev/ab3870d90247
branches:  trunk
changeset: 378215:ab3870d90247
user:      tnn <tnn%NetBSD.org@localhost>
date:      Thu Jul 27 10:32:25 2023 +0000

description:
dhcpd: move isc_event_free() before isc_timer_destroy() in timer cb

isc_timerevent_destroy() called by isc_event_free() expects to be able to
hold the timer lock, so must run before the timer is destroyed.
PR misc/57491.

diffstat:

 external/mpl/dhcp/dist/common/dispatch.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r f1f6bea7e776 -r ab3870d90247 external/mpl/dhcp/dist/common/dispatch.c
--- a/external/mpl/dhcp/dist/common/dispatch.c  Thu Jul 27 01:48:49 2023 +0000
+++ b/external/mpl/dhcp/dist/common/dispatch.c  Thu Jul 27 10:32:25 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dispatch.c,v 1.4 2023/06/27 09:10:25 martin Exp $      */
+/*     $NetBSD: dispatch.c,v 1.5 2023/07/27 10:32:25 tnn Exp $ */
 
 /* dispatch.c
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: dispatch.c,v 1.4 2023/06/27 09:10:25 martin Exp $");
+__RCSID("$NetBSD: dispatch.c,v 1.5 2023/07/27 10:32:25 tnn Exp $");
 
 #include "dhcpd.h"
 
@@ -183,6 +183,7 @@ isclib_timer_callback(isc_task_t  *taskp
                        (*q->unref) (&q->what, MDL);
                }
                q->next = free_timeouts;
+               isc_event_free(&eventp);
                isc_timer_destroy(&q->isc_timeout);
                free_timeouts = q;
        } else {
@@ -192,9 +193,9 @@ isclib_timer_callback(isc_task_t  *taskp
                 * don't try to - may change this to a log_fatal
                 */
                log_error("Error finding timer structure");
+               isc_event_free(&eventp);
        }
 
-       isc_event_free(&eventp);
        return;
 }
 



Home | Main Index | Thread Index | Old Index