Browse Source

Close file stream in term decoder.

Stefano Cossu 4 years ago
parent
commit
63b8bdc292
2 changed files with 2 additions and 0 deletions
  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;