g10: Fix memory leak.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 7 Sep 2018 04:01:52 +0000 (13:01 +0900)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sun, 30 Sep 2018 16:40:42 +0000 (17:40 +0100)
* g10/import.c (read_block): Call free_packet to skip the packet.

--

Cherry-pick of master commit of:
7c96cc67e108f3a9514a4222ffac2f9f9a2ab19e

Reported-by: Philippe Antoine
GnuPG-bug-id: 3916
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 91f8a9b33a1282cbf00cb4b71b177088f0d923d7)

Gbp-Pq: Name g10-Fix-memory-leak.patch

g10/import.c

index d7d79742c72abdd1d4f32c421706b0facac0e706..80bf7c608ffcab7774407648241716f834b6d1e0 100644 (file)
@@ -924,6 +924,8 @@ read_block( IOBUF a, int with_meta,
                 add_kbnode (root, new_kbnode (pkt));
               pkt = xmalloc (sizeof *pkt);
             }
+          else
+            free_packet (pkt, &parsectx);
           init_packet(pkt);
           break;
         }