diff options
| -rw-r--r-- | src/cleanup.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cleanup.c b/src/cleanup.c index abc55b7..f47c374 100644 --- a/src/cleanup.c +++ b/src/cleanup.c @@ -18,6 +18,17 @@ void jurl_do_cleanup(struct jurl_cleanup **src) { struct jurl_cleanup *register_cleanup(struct jurl_cleanup **prev, enum jurl_cleanup_type type) { struct jurl_cleanup *out = malloc(sizeof(struct jurl_cleanup)); + + switch (type) { + case JURL_CLEANUP_TYPE_SLIST: + out->slist = NULL; // we malloced + break; + default: + free(out); + janet_panic("unknown cleanup type in register_cleanup"); + return NULL; + } + out->next = *prev; *prev = out; out->type = type; |
