free_ext_data(struct ly_ctx *ctx, struct unres_ext *ext_data)
{
    /* cleanup on success or fatal error */
    if (ext_data->datatype == LYS_IN_YIN) {
        /* YIN */
        lyxml_free(ctx, ext_data->data.yin);
    } else {
        /* YANG */
        yang_free_ext_data(ext_data->data.yang);
    }

    free(ext_data);
}
free_ext_data(struct ly_ctx *ctx, struct unres_ext *ext_data)
{
     
    if (ext_data->datatype == LYS_IN_YIN) {
         
        lyxml_free(ctx, ext_data->data.yin);
    } else {
         
        yang_free_ext_data(ext_data->data.yang);
    }

    free(ext_data);
}