diff --git a/lib/url.c b/lib/url.c
index 234c581bf01239dd90a63f87f5421106d18e8253..cecb8b6f4a467c7f7bd0a6304a9f27885b96db58 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3682,7 +3682,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
       result = setup_range(data);
       if(result) {
         DEBUGASSERT(conn->handler->done);
-        conn->handler->done(conn, result, FALSE);
+        /* we ignore the return code for the protocol-specific DONE */
+        (void)conn->handler->done(conn, result, FALSE);
         return result;
       }