check for non-heap memory

This commit is contained in:
vscosta 2016-04-08 01:11:33 -07:00
parent fa650a6440
commit 429c8155c9
1 changed files with 2 additions and 1 deletions

View File

@ -2025,7 +2025,8 @@ X_API int YAP_InitConsult(int mode, const char *filename, int *osnop) {
f = fopen(full, "r");
if (!f)
return -1;
else
else if (full != filename && full != LOCAL_FileNameBuf &&
full != LOCAL_FileNameBuf2)
free((char *)full);
sno = Yap_OpenStream(f, NULL, TermNil, Input_Stream_f);
*osnop = Yap_CheckAlias(AtomLoopStream);