From: Jan Safranek Date: Wed, 24 Aug 2011 09:41:11 +0000 (+0200) Subject: cgsnapshot: Fixed file descriptor leak when enumerating controllers X-Git-Tag: v0.38~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8db10afa9edf30caf77081e044e95a488b77789d;p=thirdparty%2Flibcgroup.git cgsnapshot: Fixed file descriptor leak when enumerating controllers Close the iterators on error. In addition, handling when FL_SILENT flag is on/off should be the same, except the error output. Signed-off-by: Jan Safranek --- diff --git a/src/tools/cgsnapshot.c b/src/tools/cgsnapshot.c index a24dae70..51194f67 100644 --- a/src/tools/cgsnapshot.c +++ b/src/tools/cgsnapshot.c @@ -659,7 +659,6 @@ static int parse_mountpoints(cont_name_t cont_names[CG_CONTROLLER_MAX], fprintf(stderr, "E: in get next controller %s\n", cgroup_strerror(ret)); - return ret; } final_ret = ret; } @@ -681,7 +680,6 @@ static int parse_mountpoints(cont_name_t cont_names[CG_CONTROLLER_MAX], fprintf(stderr, "E: in get next controller %s\n", cgroup_strerror(ret)); - return ret; } final_ret = ret; }