]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
duid: plug a potential memory leak v9.3.1
authorRoy Marples <roy@marples.name>
Mon, 12 Oct 2020 13:56:34 +0000 (14:56 +0100)
committerRoy Marples <roy@marples.name>
Mon, 12 Oct 2020 13:56:34 +0000 (14:56 +0100)
src/duid.c

index ce9214fa79b5ec919a0dc36b34fd67505ec85f86..764c74a92e78eed639a73d1295fa92c591a08c72 100644 (file)
@@ -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