[vlc-commits] messages: fix infinite loop on error

Rémi Denis-Courmont git at videolan.org
Sun Feb 24 14:35:18 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 24 15:34:32 2019 +0200| [52dbddf4073b46a098f7fbc0f83a9e4c5873280d] | committer: Rémi Denis-Courmont

messages: fix infinite loop on error

The early logger was draining into itself, ad vitam.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=52dbddf4073b46a098f7fbc0f83a9e4c5873280d
---

 src/misc/messages.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/misc/messages.c b/src/misc/messages.c
index c184b9c6fe..89609e402d 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -315,9 +315,12 @@ static void vlc_vaLogSwitch(void *d, int type, const vlc_log_t *item,
 static void vlc_LogSwitchClose(void *d)
 {
     struct vlc_logger_switch *logswitch = d;
+    struct vlc_logger backend = logswitch->backend;
 
-    if (logswitch->backend.ops->destroy != NULL)
-        logswitch->backend.ops->destroy(logswitch->backend.sys);
+    logswitch->backend.ops = &discard_ops;
+
+    if (backend.ops->destroy != NULL)
+        backend.ops->destroy(backend.sys);
 
     vlc_rwlock_destroy(&logswitch->lock);
     free(logswitch);



More information about the vlc-commits mailing list