# HG changeset patch # User Mike Becker # Date 1444905969 -7200 # Node ID 6db9c5d7d7ffc4663acf3f539060156841892b42 # Parent cecfbb5f86180ab83ca279ba5925392e68ec540f use ucx_map_clear in dav_propfind diff -r cecfbb5f8618 -r 6db9c5d7d7ff libidav/webdav.c --- a/libidav/webdav.c Thu Oct 15 12:37:01 2015 +0200 +++ b/libidav/webdav.c Thu Oct 15 12:46:09 2015 +0200 @@ -316,21 +316,7 @@ int dav_propfind(DavSession *sn, DavResource *root, UcxBuffer *rqbuf) { // clean resource properties DavResourceData *data = root->data; - size_t pcount = data->properties->count; - if(pcount > 0) { - UcxKey key; - void *value; - UcxMapIterator i = ucx_map_iterator(data->properties); - UcxKey mkeys[pcount]; - int index = 0; - UCX_MAP_FOREACH(key, value, i) { - mkeys[index] = key; - index++; - } - for(int j=0;jproperties, mkeys[j]); - } - } + ucx_map_clear(data->properties); CURL *handle = sn->handle; util_set_url(sn, dav_resource_get_href(root)); diff -r cecfbb5f8618 -r 6db9c5d7d7ff ucx/map.c --- a/ucx/map.c Thu Oct 15 12:37:01 2015 +0200 +++ b/ucx/map.c Thu Oct 15 12:46:09 2015 +0200 @@ -83,6 +83,9 @@ } void ucx_map_clear(UcxMap *map) { + if (map->count == 0) { + return; // nothing to do + } ucx_map_free_elmlist_contents(map); memset(map->map, 0, map->size*sizeof(UcxMapElement*)); map->count = 0;