Packet streams: avoid double free if silc_id_id2str fails.
authorKp <kp@valhallalegends.com>
Sun, 1 Jun 2008 17:59:42 +0000 (12:59 -0500)
committerKp <kp@valhallalegends.com>
Mon, 1 Sep 2008 20:14:10 +0000 (15:14 -0500)
commit3661cbc69ce24b5230c8602b24927eb841933b5e
treed849a56eabf6b15336ba607530c94d6776c6defa
parent7ebc6fcc9308c92130d59641b9f85341e609708b
Packet streams: avoid double free if silc_id_id2str fails.

In silc_packet_set_ids, the old ID is freed before silc_id_id2str is
called.  If silc_id_id2str fails, then silc_packet_set_ids returns
without resetting the ID pointer.  The pointer is then free, but not
NULL.  When the packet stream is destroyed, silc_packet_stream_destroy
will free the pointer again.  Reset the ID pointer to NULL immediately
after freeing it to prevent this.
lib/silccore/silcpacket.c