diff -r 41e88442ad4e -r da079dc0724c libidav/davql.c --- a/libidav/davql.c Thu Jan 29 11:43:41 2015 +0100 +++ b/libidav/davql.c Sun Feb 08 16:36:32 2015 +0100 @@ -76,7 +76,7 @@ int depth = 1; // insert variable values - UcxBuffer *fbuf = ucx_buffer_new(NULL, 128, UCX_BUFFER_AUTOEXTEND); + UcxBuffer *fbuf = ucx_buffer_new(NULL, 1024, UCX_BUFFER_AUTOEXTEND); int var = 0; for(int i=0;iproperties = sstrdup(property_query); - getquery->from = sstrn(fbuf->space, fbuf->pos); + getquery->from = sstrdup(sstrn(fbuf->space, fbuf->pos)); getquery->depth = depth; if(condition) { getquery->condition = condition; @@ -146,12 +146,17 @@ getquery->condition = NULL; getquery->condlen = 0; } + + ucx_buffer_free(fbuf); return getquery; } void free_get_query(DavGetQuery *q) { free(q->from.ptr); free(q->properties.ptr); + if(q->condition) { + free(q->condition); + } free(q); }