From: Max Kellermann Date: Sun, 5 Nov 2017 16:18:28 +0000 (+0100) Subject: aconnect: remove bogus assertions X-Git-Tag: v0.29~3 X-Git-Url: https://git.tokkee.org/?p=ncmpc.git;a=commitdiff_plain;h=8d795d6b1ea1932823c29484a3280a5c7f8b77b5 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 --- 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);