From c2a39cb8e2b3cc717dfe273425df3f2b4d0b48c0 Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Mon, 30 May 2011 15:43:14 +0200 Subject: [PATCH] coroparse: don't leak dirent Signed-off-by: Jan Friesse Reviewed-by: Steven Dake --- exec/coroparse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exec/coroparse.c b/exec/coroparse.c index a42dbb31..488e1e97 100644 --- a/exec/coroparse.c +++ b/exec/coroparse.c @@ -254,7 +254,8 @@ static int read_uidgid_files_into_objdb( entry = malloc(len); if (entry == NULL) { - return 0; + res = 0; + goto error_exit; } for (return_code = readdir_r(dp, entry, &dirent); @@ -310,7 +311,8 @@ static int read_service_files_into_objdb( entry = malloc(len); if (entry == NULL) { - return 0; + res = 0; + goto error_exit; } for (return_code = readdir_r(dp, entry, &dirent);