소스 검색

Close file stream in term decoder.

Stefano Cossu 4 년 전
부모
커밋
63b8bdc292
2개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/codec/nt_lexer.re
  2. 1 0
      test/test_codec_nt.c

+ 1 - 0
src/codec/nt_lexer.re

@@ -304,6 +304,7 @@ LSUP_nt_parse_term (const char *rep, const LSUP_NSMap *map, LSUP_Term **term)
     int ttype = lex (&it, term);
 
     parse_done (&it);
+    fclose (stream);
 
     switch (ttype) {
         case T_IRIREF:

+ 1 - 0
test/test_codec_nt.c

@@ -186,6 +186,7 @@ test_decode_nt_term()
     for (int i = 0; i < TERM_CT - 2; i++) {
         LSUP_Term *term;
         EXPECT_PASS (nt_codec.term_decoder (start_nt[i], NULL, &term));
+        LSUP_term_free (term);
     }
 
     return 0;