mcstrans: free constraint in error branch

Free constraint, like in all other error branches.

Reported-by: Cppcheck
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2024-04-29 18:39:01 +02:00 committed by James Carter
parent 2b6f639a52
commit 55b474ee41
1 changed files with 1 additions and 0 deletions

View File

@ -477,6 +477,7 @@ add_constraint(char op, char *raw, char *tok) {
}
if (asprintf(&constraint->text, "%s%c%s", raw, op, tok) < 0) {
log_error("asprintf failed %s", strerror(errno));
free(constraint);
return -1;
}
constraint->op = op;