1
0
Fork 0
mirror of https://github.com/pnx/m16vm synced 2026-06-16 03:44:55 +02:00

src/as/ast.c: bug in ast_free(). we should advance i by sizeof(char**).

This commit is contained in:
Henrik Hautakoski 2018-12-14 00:17:42 +01:00
parent 3513662ad8
commit 1a29b39663
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -17,7 +17,7 @@ void ast_free(struct ast* ast) {
int i;
// Free all label strings
for(int i = 0; i < ast->labels.size; i++) {
for(int i = 0; i < ast->labels.size; i += sizeof(char**)) {
char *ptr = *((char**) ast->labels.base + i);
free(ptr);
}