]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Add missing test to cgroup_read_stats_end
authorIvana Hutarova Varekova <varekova@redhat.com>
Tue, 7 Sep 2010 18:06:54 +0000 (23:36 +0530)
committerBalbir Singh <balbir@linux.vnet.ibm.com>
Tue, 7 Sep 2010 18:06:54 +0000 (23:36 +0530)
This patch adds the missing test to cgroup_read_stats_end
Sorry for the misstake.
Fixed the test - it should return the error

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
src/api.c

index 935fad943e54cb4dd869dd97c0e5ad2740cd2b77..b9a906f179e4ac27185a8b7541e7a71a545a9719 100644 (file)
--- a/src/api.c
+++ b/src/api.c
@@ -2841,6 +2841,9 @@ int cgroup_read_stats_end(void **handle)
                return ECGINVAL;
 
        fp = (FILE *)*handle;
+       if (fp == NULL)
+               return ECGINVAL;
+
        fclose(fp);
        return 0;
 }