JSON protocol: fix sub field sending memory leak.
commit0cd5d9d5840383e3308f288def3cce79eff3056d
authorsveinung <sveinung@a0f10bec-cc02-0410-94fc-a9cfff90b4cd>
Wed, 10 May 2017 08:14:40 +0000 (10 08:14 +0000)
committersveinung <sveinung@a0f10bec-cc02-0410-94fc-a9cfff90b4cd>
Wed, 10 May 2017 08:14:40 +0000 (10 08:14 +0000)
tree1b396efde75a66411354ec4452d3931af2375dfc
parent336fb2aa47cf50a5ef0de41c12665580316dd2c1
JSON protocol: fix sub field sending memory leak.

Steal the references to values created inline when put inside an object by
using json_object_set_new() rather than json_object_set().

Found with Valgrind.
Reported by Andreas Røsdal

See hrm Bug #658386

git-svn-id: svn://svn.gna.org/svn/freeciv/trunk@35473 a0f10bec-cc02-0410-94fc-a9cfff90b4cd
common/networking/dataio_json.c