From 40a08e98eee7c7458e67a2e30aba2b8b42b2aba2 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 12 Oct 2020 14:56:34 +0100 Subject: [PATCH] duid: plug a potential memory leak --- src/duid.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/duid.c b/src/duid.c index ce9214fa..764c74a9 100644 --- a/src/duid.c +++ b/src/duid.c @@ -178,8 +178,9 @@ duid_get(struct dhcpcd_ctx *ctx, const struct interface *ifp) if (ifp == NULL) { if (ctx->duid_type != DUID_DEFAULT && ctx->duid_type != DUID_UUID) - return 0; - len = duid_make_uuid(data); + len = 0; + else + len = duid_make_uuid(data); if (len == 0) free(data); else -- 2.47.2