git: 781624ca2d05 - main - getfacl: free `acl` in print_acl error path

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Thu, 22 Jun 2023 05:00:29 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=781624ca2d054430052c828ba8d2c2eaf2d733e7

commit 781624ca2d054430052c828ba8d2c2eaf2d733e7
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2023-06-22 04:58:33 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2023-06-22 04:58:33 +0000

    getfacl: free `acl` in print_acl error path
    
    Sponsored by:   Klara, Inc.
---
 bin/getfacl/getfacl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/getfacl/getfacl.c b/bin/getfacl/getfacl.c
index ecdc73f74fbc..a077cb8780b8 100644
--- a/bin/getfacl/getfacl.c
+++ b/bin/getfacl/getfacl.c
@@ -157,6 +157,7 @@ print_acl(char *path, acl_type_t type, int hflag, int iflag, int nflag,
 	acl_text = acl_to_text_np(acl, 0, flags);
 	if (!acl_text) {
 		warn("%s: acl_to_text_np() failed", path);
+		(void)acl_free(acl);
 		return(-1);
 	}