From 88a4c6f4441941409b4846811d492f243f799c2d Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 5 Mar 2021 15:53:20 -0600 Subject: [PATCH] asn1: Fix leak in asn1_print --- lib/asn1/asn1_print.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/asn1/asn1_print.c b/lib/asn1/asn1_print.c index 693343840..20558e93d 100644 --- a/lib/asn1/asn1_print.c +++ b/lib/asn1/asn1_print.c @@ -439,6 +439,7 @@ dotype(unsigned char *buf, size_t len, char **argv, size_t *size) errx(1, "Encoding failed"); if (memcmp(buf, der, sz)) errx(1, "Encoding did not round trip"); + free(der); } if (test_copy_flag) { void *vcpy = ecalloc(1, sorted_types[i].sz); @@ -457,6 +458,7 @@ dotype(unsigned char *buf, size_t len, char **argv, size_t *size) errx(1, "Encoding of copy failed"); if (memcmp(buf, der, sz)) errx(1, "Encoding of copy did not round trip"); + free(der); } sorted_types[i].release(vcpy); free(vcpy);