Message ID | 1467702040-14764-1-git-send-email-wangshilong1991@gmail.com |
---|---|
State | Not Applicable, archived |
Headers | show |
On Tue 05-07-16 16:00:40, Wang Shilong wrote: > From: Wang Shilong <wshilong@ddn.com> > > 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> Thanks. I've merged the patch. Honza
diff --git a/quotasys.c b/quotasys.c index c78e02c..d04f25a 100644 --- a/quotasys.c +++ b/quotasys.c @@ -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 */