summaryrefslogtreecommitdiffstats
path: root/ldpd/ldpd.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-07 14:53:10 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2021-10-07 15:01:03 +0200
commit7640e3c60b33e13376185a0e0c85f3f6c272d0a9 (patch)
tree91dddddd3fe42fc4ce3e93d452b11504cf829083 /ldpd/ldpd.c
parentMerge pull request #9758 from idryzhov/resolver-thread (diff)
downloadfrr-7640e3c60b33e13376185a0e0c85f3f6c272d0a9.tar.xz
frr-7640e3c60b33e13376185a0e0c85f3f6c272d0a9.zip
*: don't pass pointers to a local variables to thread_add_*
We should never pass pointers to local variables to thread_add_* family. When an event is executed, the library writes into this pointer, which means it writes into some random memory on a stack. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ldpd/ldpd.c')
-rw-r--r--ldpd/ldpd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index 9d80bed77..0ff3238ff 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -243,7 +243,6 @@ main(int argc, char *argv[])
int pipe_parent2ldpe[2], pipe_parent2ldpe_sync[2];
int pipe_parent2lde[2], pipe_parent2lde_sync[2];
char *ctl_sock_name;
- struct thread *thread = NULL;
bool ctl_sock_used = false;
snprintf(ctl_sock_path, sizeof(ctl_sock_path), LDPD_SOCKET,
@@ -393,7 +392,7 @@ main(int argc, char *argv[])
frr_config_fork();
/* apply configuration */
- thread_add_event(master, ldp_config_fork_apply, NULL, 0, &thread);
+ thread_add_event(master, ldp_config_fork_apply, NULL, 0, NULL);
/* setup pipes to children */
if ((iev_ldpe = calloc(1, sizeof(struct imsgev))) == NULL ||