From 429c8155c9012b12f59486056d00412a027188e6 Mon Sep 17 00:00:00 2001 From: vscosta Date: Fri, 8 Apr 2016 01:11:33 -0700 Subject: [PATCH] check for non-heap memory --- C/c_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C/c_interface.c b/C/c_interface.c index e021bdb5c..7cc32b0fc 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -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);