aboutsummaryrefslogtreecommitdiff
path: root/procfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 13:06:13 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 13:06:13 +0100
commitbeb16d36b0b2c85496a7b355425f05cfb2f7e3fb (patch)
tree6383bbf7d9f2a19292549832d740e6166c8b5e49 /procfs
parent722fe2c063c33ba752f53000c209550a0aeb5f07 (diff)
downloadhurd-beb16d36b0b2c85496a7b355425f05cfb2f7e3fb.tar.gz
hurd-beb16d36b0b2c85496a7b355425f05cfb2f7e3fb.tar.bz2
hurd-beb16d36b0b2c85496a7b355425f05cfb2f7e3fb.zip
procfs: Avoid fclosing NULL on memory shortage
Diffstat (limited to 'procfs')
-rw-r--r--procfs/rootdir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/procfs/rootdir.c b/procfs/rootdir.c
index bb49ce5f..d6992911 100644
--- a/procfs/rootdir.c
+++ b/procfs/rootdir.c
@@ -337,7 +337,8 @@ rootdir_gc_meminfo (void *hook, char **contents, ssize_t *contents_len)
(long unsigned) swap.dpi_free_space / 1024);
out:
- fclose (m);
+ if (m)
+ fclose (m);
return err;
}