Yes, you're responsible for storing the pointer and freeing the buffer. The engine won't do that for you. See Manual -> C-Script -> add_buffer. The function can't fail and thus won't return a value.