catbuf_dup - duplicate a buffer
#include <cat.h>
cat_buffer *catbuf_dup(cat_session *sess, cat_buffer *buf);
catbuf_dup() creates and returns a copy of a buffer. A new buffer is allocated and the
data from buf is copied to the new buffer. buf is unaffected by the operation.
The new buffer will be associated with session sess.
Returns a pointer to a copy of the supplied buffer if successful, and a
NULL pointer otherwise. The returned buffer should be freed with the catbuf_free() function.
cat, catbuf