From 7ebc6fcc9308c92130d59641b9f85341e609708b Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 1 Jun 2008 12:25:50 -0500 Subject: [PATCH] Packet streams: fix memory leak on dlist allocation failure. If silc_dlist_init fails to allocate a SilcDList for stream->process, then silc_packet_stream_link_va leaks the newly allocated SilcPacketProcess. Fix that by calling silc_free(p) on the error path. --- lib/silccore/silcpacket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/silccore/silcpacket.c b/lib/silccore/silcpacket.c index d0445019..df195f67 100644 --- a/lib/silccore/silcpacket.c +++ b/lib/silccore/silcpacket.c @@ -1030,6 +1030,7 @@ static SilcBool silc_packet_stream_link_va(SilcPacketStream stream, stream->process = silc_dlist_init(); if (!stream->process) { silc_mutex_unlock(stream->lock); + silc_free(p); return FALSE; } } -- 2.24.0