diff options
Diffstat (limited to 'web/web_dom.c')
-rw-r--r-- | web/web_dom.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/web/web_dom.c b/web/web_dom.c index 5ce7a3f..eadca7f 100644 --- a/web/web_dom.c +++ b/web/web_dom.c @@ -13,12 +13,12 @@ struct dom_elem *dom_elem_init(char *ns, char *name, int size_attrs) e->ns = ns ? strdup(ns) : NULL; e->name = strdup(name); + e->content = NULL; e->n_attrs = 0; e->size_attrs = size_attrs; e->attr_names = malloc(size_attrs * sizeof(*(e->attr_names))); e->attr_vals = malloc(size_attrs * sizeof(*(e->attr_vals))); - e->content = NULL; return e; } @@ -30,10 +30,11 @@ void dom_elem_free(struct dom_elem *e) free(e->attr_vals[i]); } + free(e->ns); + free(e->name); free(e->content); free(e->attr_names); free(e->attr_vals); - free(e->name); free(e); } @@ -58,7 +59,7 @@ void dom_elem_add_attrd(struct dom_elem *e, char *name, double val) dom_elem_add_attr(e, name, str); } -void dom_append_elemv(char *sel, int elemc, struct dom_elem **elemv) +inline void dom_append_elemv(char *sel, int elemc, struct dom_elem **elemv) { EM_ASM({elemAppendElemv($0, $1, $2, $3, $4, $5, $6, $7, $8)}, sel, elemc, elemv, |