Files
jq/src
Emanuele Torre ae95864b6b Make sure to free default @text format on error
It seems that bison doesn't call destructors for mid-rule action
components on error, since it does not know their type.

A mid-rule action was used to allocate the "text" string used as format
by string literals without a format, which would leak on error.
This patch replaces it with a new NoFormat component of type <literal>.
Now bison will call jv_free() on that string after a syntax error.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60836

  $ ./jq '"'
  jq: error: syntax error, unexpected end of file, expecting QQSTRING_TEXT or QQSTRING_INTERP_START or QQSTRING_END (Unix shell quoting issues?) at <top-level>, line 1:
  "
  jq: 1 compile error

  =================================================================
  ==1495450==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 21 byte(s) in 1 object(s) allocated from:
      #0 0x7fc21aee1359 in __interceptor_malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
      #1 0x557ccb6ff608 in jv_mem_alloc src/jv_alloc.c:141

  SUMMARY: AddressSanitizer: 21 byte(s) leaked in 1 allocation(s).
2023-07-25 14:51:58 -05:00
..
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2023-07-24 11:55:15 -05:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2020-12-19 15:18:29 -05:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2023-07-25 10:21:01 -05:00
2015-08-23 20:36:11 -07:00