]> git.ipfire.org Git - thirdparty/tvheadend.git/commit
Fix use-after-free
authordave-p <gh@pickles.me.uk>
Fri, 1 Jul 2022 13:56:09 +0000 (14:56 +0100)
committerFlole998 <Flole998@users.noreply.github.com>
Mon, 4 Jul 2022 00:22:44 +0000 (02:22 +0200)
commit351b5b4158e4201b3567371f80775aca182cbb0e
treec3d8416abb979f9a0be21ae24756c9269815c975
parentfbc94aee8bfdd25baba87ab62a39234da20e8dd2
Fix use-after-free

Building Tvheadend on Raspberry Pi with gcc 12 fails with this error

src/misc/json.c: In function ‘json_parse_string’:
src/misc/json.c:120:31: error: pointer ‘r’ used after ‘free’ [-Werror=use-after-free]
  120 |                   *failp = (a - r) + start;
      |                            ~~~^~~~
src/misc/json.c:118:19: note: call to ‘free’ here
  118 |                   free(r);
      |                   ^~~~~~~

This PR appears correct and fixes the gcc error but has not been tested as it is an error path.
src/misc/json.c