diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index ffc1d17f517a..f3f8b8510257 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -49,6 +49,7 @@ struct ldpd_conf *leconf; struct ldpd_sysdep sysdep; #endif +static struct imsgev iev_main_data; static struct imsgev *iev_main, *iev_main_sync; static struct imsgev *iev_lde; #ifdef __OpenBSD__ @@ -124,8 +125,8 @@ ldpe(void) &iev_main->ev_read); iev_main->handler_write = ldp_write_handler; - if ((iev_main_sync = calloc(1, sizeof(struct imsgev))) == NULL) - fatal(NULL); + memset(&iev_main_data, 0, sizeof(iev_main_data)); + iev_main_sync = &iev_main_data; imsg_init(&iev_main_sync->ibuf, LDPD_FD_SYNC); /* create base configuration */ @@ -231,7 +232,6 @@ ldpe_shutdown(void) if (iev_lde) free(iev_lde); free(iev_main); - free(iev_main_sync); free(pkt_ptr); log_info("ldp engine exiting");