pespin submitted this change.
logging_file: Fix log_target_file_switch_to_stream on stderr
In stderr log target, the bfd of the wq was left registered despite
freeing the wq, which ended up in the callback being called and the
freed wq being used.
Change-Id: I1c0d833fb8ae82d1dd54e44cc2fc8be80d5e1b4b
---
M src/core/logging_file.c
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/core/logging_file.c b/src/core/logging_file.c
index 6e01c26..99a797c 100644
--- a/src/core/logging_file.c
+++ b/src/core/logging_file.c
@@ -213,11 +213,10 @@
}
/* now that everything succeeded, we can finally close the old output fd */
- if (target->type == LOG_TGT_TYPE_FILE) {
- osmo_fd_unregister(&wq->bfd);
+ osmo_fd_unregister(&wq->bfd);
+ if (target->type == LOG_TGT_TYPE_FILE)
close(wq->bfd.fd);
- wq->bfd.fd = -1;
- }
+ wq->bfd.fd = -1;
/* release the queue itself */
talloc_free(wq);
To view, visit change 41975. To unsubscribe, or for help writing mail filters, visit settings.