void nbd_client_put(NBDClient *client)

{

    if (--client->refcount == 0) {

        /* The last reference should be dropped by client->close,

         * which is called by nbd_client_close.

         */

        assert(client->closing);



        nbd_unset_handlers(client);

        close(client->sock);

        client->sock = -1;

        if (client->exp) {

            QTAILQ_REMOVE(&client->exp->clients, client, next);

            nbd_export_put(client->exp);

        }

        g_free(client);

    }

}

void nbd_client_put(NBDClient *client)

{

    if (--client->refcount == 0) {

        





        assert(client->closing);



        nbd_unset_handlers(client);

        close(client->sock);

        client->sock = -1;

        if (client->exp) {

            QTAILQ_REMOVE(&client->exp->clients, client, next);

            nbd_export_put(client->exp);

        }

        g_free(client);

    }

}

void FUNC_0(NBDClient *VAR_0)

{

    if (--VAR_0->refcount == 0) {

        





        assert(VAR_0->closing);



        nbd_unset_handlers(VAR_0);

        close(VAR_0->sock);

        VAR_0->sock = -1;

        if (VAR_0->exp) {

            QTAILQ_REMOVE(&VAR_0->exp->clients, VAR_0, next);

            nbd_export_put(VAR_0->exp);

        }

        g_free(VAR_0);

    }

}

void FUNC_0(NBDClient *VAR_0)
{ if (--VAR_0->refcount == 0) { assert(VAR_0->closing); nbd_unset_handlers(VAR_0); close(VAR_0->sock); VAR_0->sock = -1; if (VAR_0->exp) { QTAILQ_REMOVE(&VAR_0->exp->clients, VAR_0, next); nbd_export_put(VAR_0->exp); } g_free(VAR_0); } }