18:651989681053 | 19:18efd2c2973d |
---|---|
43 DavContext* dav_context_new() { | 43 DavContext* dav_context_new() { |
44 DavContext *context = malloc(sizeof(DavContext)); | 44 DavContext *context = malloc(sizeof(DavContext)); |
45 if(!context) { | 45 if(!context) { |
46 return NULL; | 46 return NULL; |
47 } | 47 } |
48 context->sessions = NULL; | |
48 context->namespaces = ucx_map_new(16); | 49 context->namespaces = ucx_map_new(16); |
49 if(!context->namespaces) { | 50 if(!context->namespaces) { |
50 free(context); | 51 free(context); |
51 return NULL; | 52 return NULL; |
52 } | 53 } |
75 } | 76 } |
76 | 77 |
77 UcxMapIterator i = ucx_map_iterator(ctx->namespaces); | 78 UcxMapIterator i = ucx_map_iterator(ctx->namespaces); |
78 UcxKey k; | 79 UcxKey k; |
79 DavNamespace *ns; | 80 DavNamespace *ns; |
80 UCX_MAP_FOREACH(k, ns, i) { | 81 // TODO: free map elements |
81 free(ns->prefix); | |
82 free(ns->name); | |
83 free(ns); | |
84 } | |
85 ucx_map_free(ctx->namespaces); | 82 ucx_map_free(ctx->namespaces); |
86 free(ctx); | 83 free(ctx); |
87 } | 84 } |
88 | 85 |
89 int dav_add_namespace(DavContext *context, char *prefix, char *name) { | 86 int dav_add_namespace(DavContext *context, char *prefix, char *name) { |