From b7f9d3b49160538d9d77723e80307cdfb2d071d0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 31 Jul 2014 10:12:15 +0200 Subject: [PATCH] uwrap: Fix memory leak on error. Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- lib/uid_wrapper/uid_wrapper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c index cb99481993a..742903a11d7 100644 --- a/lib/uid_wrapper/uid_wrapper.c +++ b/lib/uid_wrapper/uid_wrapper.c @@ -431,6 +431,7 @@ static int uwrap_new_id(pthread_t tid, bool do_alloc) id->groups = malloc(sizeof(gid_t) * 1); if (id->groups == NULL) { + SAFE_FREE(id); errno = ENOMEM; return -1; } -- 2.11.4.GIT