See the example code below. If I don't use static buffer and instead rely on the library code to allocate it for me then the code crashes without extra call for tp_ensure():
#include "tp.h"
int main() {
struct tp req;
tp_init(&req, NULL, 0, tp_realloc, NULL);
tp_ensure(&req, 100); /* if this line is commented out the the code crashes in call to tp_tuple */
tp_select(&req, 0, 0, 0, 0);
tp_tuple(&req);
tp_sz(&req, "key");
free(req.s);
return 0;
}