| 63 | } |
| 64 | |
| 65 | static struct command_result *make_callback(struct command *cmd, |
| 66 | struct param *def, |
| 67 | const char *buffer, |
| 68 | const jsmntok_t *tok) |
| 69 | { |
| 70 | /* If it had a default, free that now to avoid leak */ |
| 71 | if ((def->style == PARAM_OPTIONAL_WITH_DEFAULT |
| 72 | || def->style == PARAM_OPTIONAL_DEV_WITH_DEFAULT) |
| 73 | && !def->is_set) |
| 74 | tal_free(*(void **)def->arg); |
| 75 | |
| 76 | def->is_set = true; |
| 77 | |
| 78 | return def->cbx(cmd, def->name, buffer, tok, def->arg); |
| 79 | } |
| 80 | |
| 81 | static struct command_result *post_check(struct command *cmd, |
| 82 | struct param *params) |
no test coverage detected