Преглед на файлове

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;