Content-Type: multipart/mixed; boundary="===============1813261509926246618==" MIME-Version: 1.0 From: James Prestwood Subject: [PATCH v9 4/4] unit: fix memory leak in test-pem Date: Fri, 04 Oct 2019 12:21:24 -0700 Message-ID: <20191004192124.16536-4-prestwoj@gmail.com> In-Reply-To: <20191004192124.16536-1-prestwoj@gmail.com> List-Id: To: ell@lists.01.org --===============1813261509926246618== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --- unit/test-pem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unit/test-pem.c b/unit/test-pem.c index 6a927fc..f1c202f 100644 --- a/unit/test-pem.c +++ b/unit/test-pem.c @@ -226,7 +226,7 @@ static void test_pem(const void *data) { const struct pem_test *test =3D data; uint8_t *decoded; - char *label; + char *label =3D NULL; size_t decoded_size; = decoded =3D l_pem_load_buffer((const uint8_t *) test->input, @@ -234,6 +234,8 @@ static void test_pem(const void *data) &label, &decoded_size); = if (!test->valid) { + if (label) + l_free(label); assert(!decoded); return; } -- = 2.17.1 --===============1813261509926246618==--