diff options
author | Wang Shilong <wshilong@ddn.com> | 2016-07-05 16:00:40 +0900 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2016-07-06 11:40:22 +0200 |
commit | 3715b0f5bd11116796f5f80144ceefe539b320aa (patch) | |
tree | 64080f5491673d44da16a6b4e4651a2fd0474b1f | |
parent | 2432de0526c282f05010cfa432059cbc9e794259 (diff) | |
download | quota-tools-3715b0f5bd11116796f5f80144ceefe539b320aa.tar.gz |
quota: fix coredump if projid file does not exist
if '/etc/projid' dose not exist,@project_file will
be NULL pointer, fclose will cause coredump, add
check in endprent().
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | quotasys.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -98,8 +98,10 @@ void setprent(void) /* Close /etc/projid file */ void endprent(void) { - fclose(project_file); - project_file = NULL; + if (project_file) { + fclose(project_file); + project_file = NULL; + } } /* Get next entry in /etc/projid */ |