From b10dadce5a3c921149b2c9fe0dec614f8076ebda Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 16 Oct 2018 18:10:05 +0200 Subject: build: Free memory before return{,_val}_if_* macros --- trust/persist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'trust/persist.c') diff --git a/trust/persist.c b/trust/persist.c index 887b316..569cea1 100644 --- a/trust/persist.c +++ b/trust/persist.c @@ -89,7 +89,10 @@ p11_persist_new (void) return_val_if_fail (persist != NULL, NULL); persist->constants = p11_constant_reverse (true); - return_val_if_fail (persist->constants != NULL, NULL); + if (persist->constants == NULL) { + free (persist); + return_val_if_reached (NULL); + } return persist; } -- cgit v1.1