Hello Gustavo,
first of all you don't need to call iov_dup() unless you modify it before WIND() or you need it at the callback. If you need to make some changes to the vector list, then you mush call iov_dup(), make the changes, call one or more WINDs() (if needed) and free it with GF_FREE(). If you use the vector list in the callback, you must not free it until the callback. In all other cases, you can pass the same pointer you received to the next translator through a WIND() without allocating a new one. On the other hand, I'm not sure this is the real cause of the memory leak. iov_dup() only duplicates the array of pointers, but not the buffers themselves. If you are also copying the buffers, then you must also free them. The best way is calling iov_free(), which releases both buffers and the array of pointers. Regards, Xavi Al 30/10/12 11:16, En/na Gustavo Bervian Brand ha escrit:
|