From 8d795d6b1ea1932823c29484a3280a5c7f8b77b5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 5 Nov 2017 17:18:28 +0100 Subject: [PATCH] aconnect: remove bogus assertions async_rconnect_start() attempts to resolve the host name before it allocates a struct async_rconnect, and therefore the error callback may be invoked before "*rcp" gets assigned. The solution is trivial: remove those assertions, because they are wrong. Closes #10 --- NEWS | 1 + src/aconnect.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ab2d153..d202e74 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ncmpc 0.29 - not yet released * fix crash after losing MPD connection +* fix crash after DNS lookup error ncmpc 0.28 - (2017-09-21) * fix crash on lyrics screen diff --git a/src/aconnect.c b/src/aconnect.c index 701dbec..82085ed 100644 --- a/src/aconnect.c +++ b/src/aconnect.c @@ -107,7 +107,6 @@ static void aconnect_rconnect_success(int fd, void *ctx) { struct aconnect *ac = ctx; - assert(ac->rconnect != NULL); ac->rconnect = NULL; ac->fd = fd; @@ -122,7 +121,6 @@ static void aconnect_rconnect_error(const char *message, void *ctx) { struct aconnect *ac = ctx; - assert(ac->rconnect != NULL); ac->rconnect = NULL; ac->handler->error(message, ac->handler_ctx); -- 2.30.2