g10: Fix memory leak.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 7 Sep 2018 04:01:52 +0000 (13:01 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 7 Sep 2018 04:01:52 +0000 (13:01 +0900)
* g10/import.c (read_block): Call free_packet to skip the packet.

--

Reported-by: Philippe Antoine
GnuPG-bug-id: 3916
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
g10/import.c

index 73f795c..dbf6000 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;
         }