From bc6b99e8ffc022f5fc36a640141001917d7cf2e8 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 5 Feb 2012 23:14:32 +0100 Subject: [PATCH] libprocps: open file should be closed, not freed Signed-off-by: Sami Kerola --- proc/slab.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proc/slab.c b/proc/slab.c index 66b0d4b5..c1e86248 100644 --- a/proc/slab.c +++ b/proc/slab.c @@ -313,13 +313,13 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats) if (!fgets(buffer, SLABINFO_VER_LEN, slabfile)) { fprintf(stderr, "cannot read from slabinfo\n"); - free(slabfile); + fclose(slabfile); return 1; } if (sscanf(buffer, "slabinfo - version: %d.%d", &major, &minor) != 2) { fprintf(stderr, "not the good old slabinfo we know\n"); - free(slabfile); + fclose(slabfile); return 1; } @@ -331,7 +331,7 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats) ret = parse_slabinfo10(list, stats, slabfile); else { fprintf(stderr, "unrecognizable slabinfo version\n"); - free(slabfile); + fclose(slabfile); return 1; }