Skip to content

Commit

Permalink
Add some assertions to the template compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed Aug 19, 2024
1 parent 23227c8 commit 83b8725
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/lwan-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,8 @@ static bool post_process_template(struct parser *parser)
break;
}

assert(prev_chunk->flags & FLAGS_NO_FREE);

struct chunk_descriptor *cd = malloc(sizeof(*cd));
if (!cd)
lwan_status_critical_perror("malloc");
Expand Down Expand Up @@ -1152,6 +1154,8 @@ static bool post_process_template(struct parser *parser)
}
}

assert(prev_chunk->flags & FLAGS_NO_FREE);

struct chunk_descriptor *cd = malloc(sizeof(*cd));
if (!cd)
lwan_status_critical_perror("malloc");
Expand Down

0 comments on commit 83b8725

Please sign in to comment.