Skip to content
  • Markus Armbruster's avatar
    fdceb4ab
    io: Fix qio_channel_socket_close() error handling · fdceb4ab
    Markus Armbruster authored
    
    
    The Error ** argument must be NULL, &error_abort, &error_fatal, or a
    pointer to a variable containing NULL.  Passing an argument of the
    latter kind twice without clearing it in between is wrong: if the
    first call sets an error, it no longer points to NULL for the second
    call.
    
    qio_channel_socket_close() passes @errp first to
    socket_listen_cleanup(), and then, if closesocket() fails, to
    error_setg_errno().  If socket_listen_cleanup() failed, this will trip
    the assertion in error_setv().
    
    Fix by ignoring a second error.
    
    Fixes: 73564c40
    Cc: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200422130719.28225-11-armbru@redhat.com>
    fdceb4ab
    io: Fix qio_channel_socket_close() error handling
    Markus Armbruster authored
    
    
    The Error ** argument must be NULL, &error_abort, &error_fatal, or a
    pointer to a variable containing NULL.  Passing an argument of the
    latter kind twice without clearing it in between is wrong: if the
    first call sets an error, it no longer points to NULL for the second
    call.
    
    qio_channel_socket_close() passes @errp first to
    socket_listen_cleanup(), and then, if closesocket() fails, to
    error_setg_errno().  If socket_listen_cleanup() failed, this will trip
    the assertion in error_setv().
    
    Fix by ignoring a second error.
    
    Fixes: 73564c40
    Cc: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200422130719.28225-11-armbru@redhat.com>
Loading