]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
cgsnapshot: Fixed file descriptor leak when enumerating controllers
authorJan Safranek <jsafrane@redhat.com>
Wed, 24 Aug 2011 09:41:11 +0000 (11:41 +0200)
committerJan Safranek <jsafrane@redhat.com>
Wed, 14 Sep 2011 11:24:11 +0000 (13:24 +0200)
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 <jsafrane@redhat.com>
src/tools/cgsnapshot.c

index a24dae7081fab63f0a3d071b9f86647a2bdbb7ef..51194f6749297ce09fc2a71b9363a0f7731db374 100644 (file)
@@ -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;
        }