fixed a segfault bug when the source file cannot be opened
This commit is contained in:
parent
2a40be7742
commit
c613b6955d
@ -209,7 +209,6 @@ static MOO_INLINE moo_ooi_t open_input (moo_t* moo, moo_ioarg_t* arg)
|
||||
#endif
|
||||
if (!bb->fp)
|
||||
{
|
||||
fclose (bb->fp);
|
||||
moo_seterrnum (moo, MOO_EIOERR);
|
||||
goto oops;
|
||||
}
|
||||
@ -218,7 +217,11 @@ static MOO_INLINE moo_ooi_t open_input (moo_t* moo, moo_ioarg_t* arg)
|
||||
return 0;
|
||||
|
||||
oops:
|
||||
if (bb) moo_freemem (moo, bb);
|
||||
if (bb)
|
||||
{
|
||||
if (bb->fp) fclose (bb->fp);
|
||||
moo_freemem (moo, bb);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -279,17 +279,12 @@ CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
AM_RECURSIVE_TARGETS = cscope
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config-h.in \
|
||||
$(top_srcdir)/../ac/compile \
|
||||
$(top_srcdir)/../ac/config.guess \
|
||||
$(top_srcdir)/../ac/config.sub \
|
||||
$(top_srcdir)/../ac/depcomp \
|
||||
$(top_srcdir)/../ac/install-sh \
|
||||
$(top_srcdir)/../ac/ltmain.sh \
|
||||
$(top_srcdir)/../ac/missing ../ac/compile \
|
||||
../ac/config.guess ../ac/config.sub \
|
||||
../ac/depcomp ../ac/install-sh \
|
||||
../ac/ltmain.sh \
|
||||
../ac/missing COPYING.LIB \
|
||||
$(top_srcdir)/../ac/compile $(top_srcdir)/../ac/config.guess \
|
||||
$(top_srcdir)/../ac/config.sub $(top_srcdir)/../ac/depcomp \
|
||||
$(top_srcdir)/../ac/install-sh $(top_srcdir)/../ac/ltmain.sh \
|
||||
$(top_srcdir)/../ac/missing ../ac/ar-lib ../ac/compile \
|
||||
../ac/config.guess ../ac/config.sub ../ac/depcomp \
|
||||
../ac/install-sh ../ac/ltmain.sh ../ac/missing COPYING.LIB \
|
||||
README lt__argz.c lt__dirent.c lt__strl.c
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
Loading…
Reference in New Issue
Block a user