0

I have an RPC server that transfers a large amount of variable length data to the client. The .x file looks something like this

struct file
{
    opaque data<>
};

In the server routine, I have

struct file *transfer_1_svc(...)
{
    struct file;

    file.data.data_val = malloc(...);

    return &file;
}

My question is who frees the data allocated in the server routine?

steve landiss
  • 1,833
  • 3
  • 19
  • 30

1 Answers1

0

This depends on your server code. If you use rpcgen to produce server stub, then you can use xdr_free function which will free the result. Check SunRPC developer guide for details: https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html

kofemann
  • 4,217
  • 1
  • 34
  • 39