From: Ivana Hutarova Varekova Date: Tue, 7 Sep 2010 18:06:54 +0000 (+0530) Subject: Add missing test to cgroup_read_stats_end X-Git-Tag: v0.37.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5d3d1ef7010ce438582140fcf4ca7bee03ca7cd;p=thirdparty%2Flibcgroup.git Add missing test to cgroup_read_stats_end 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 Signed-off-by: Balbir Singh --- diff --git a/src/api.c b/src/api.c index 935fad94..b9a906f1 100644 --- 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; }