[PATCH 3/3] mcstrans: free constraint in error branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>

Free constraint, like in all other error branches.

Reported-by: Cppcheck
Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
---
 mcstrans/src/mcstrans.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mcstrans/src/mcstrans.c b/mcstrans/src/mcstrans.c
index fded3235..7667e131 100644
--- a/mcstrans/src/mcstrans.c
+++ b/mcstrans/src/mcstrans.c
@@ -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;
-- 
2.43.0





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux