From: Roy Marples Date: Mon, 12 Oct 2020 13:56:34 +0000 (+0100) Subject: duid: plug a potential memory leak X-Git-Tag: v9.3.1^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40a08e98eee7c7458e67a2e30aba2b8b42b2aba2;p=thirdparty%2Fdhcpcd.git duid: plug a potential memory leak --- 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