diff -r 923a4528a2ae -r d53fd1006485 dav/finfo.c --- a/dav/finfo.c Thu Mar 14 17:43:31 2019 +0100 +++ b/dav/finfo.c Fri Mar 15 20:30:09 2019 +0100 @@ -169,7 +169,12 @@ free(attributes); - return xattr; + if(nattr > 0) { + return xattr; + } else { + xattributes_free(xattr); + return NULL; + } } int resource_set_xattr(DavResource *res, XAttributes *xattr) { @@ -200,5 +205,10 @@ } void xattributes_free(XAttributes *xattr) { - + free(xattr->hash); + for(int i=0;inattr;i++) { + free(xattr->names[i]); + free(xattr->values[i].ptr); + } + free(xattr); }