[PATCH v2 01/10] sandbox/seunshare: free glob on error path

Stephen Smalley <[email protected]>
Newsgroups org.kernel.vger.selinux
Message-ID <[email protected]>
Free the glob on the error path for a failed calloc.

Signed-off-by: Stephen Smalley <[email protected]>
---
 sandbox/seunshare.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sandbox/seunshare.c b/sandbox/seunshare.c
index f2d637e1..0c32d03f 100644
--- a/sandbox/seunshare.c
+++ b/sandbox/seunshare.c
@@ -448,6 +448,7 @@ static int rsynccmd(const char *src, const char *dst, char ***cmd)
 	*cmd = calloc(3 + fglob.gl_pathc + 2, sizeof(char *));
 	if (!*cmd) {
 		fprintf(stderr, _("Out of memory\n"));
+		globfree(&fglob);
 		return -1;
 	}
 
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.