Code

aconnect: assign variable first, then start connect
authorMax Kellermann <max.kellermann@gmail.com>
Sat, 25 Mar 2017 19:20:30 +0000 (20:20 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Sat, 25 Mar 2017 19:20:41 +0000 (20:20 +0100)
Fixes bogus assertion failure.

NEWS
src/aconnect.c

diff --git a/NEWS b/NEWS
index 2e36c8abe327e50f6c185c13f2fcc7611db9584d..6956a1e50443562172eabd17bdf14393924718c8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
 ncmpc 0.27 - not yet released
 * remove the status bar clock (option "display-time")
+* fix assertion failure after connect failure
 
 ncmpc 0.26 - (2017-03-20)
 * require libmpdclient 2.9
index 345bc52c8f5e1dde1738c54448883d579031dffb..a0f73154a75fbbdd5ca5966fb4c0d5992d983b24 100644 (file)
@@ -144,10 +144,10 @@ aconnect_start(struct aconnect **acp,
        ac->handler = handler;
        ac->handler_ctx = ctx;
 
+       *acp = ac;
+
        async_rconnect_start(&ac->rconnect, host, port,
                             &aconnect_rconnect_handler, ac);
-
-       *acp = ac;
 }
 
 void