]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Revert issue in initial kroutes
authorRoy Marples <roy@marples.name>
Tue, 1 Apr 2025 14:41:37 +0000 (15:41 +0100)
committerRoy Marples <roy@marples.name>
Tue, 1 Apr 2025 14:41:37 +0000 (15:41 +0100)
src/route.c

index 2b1e038cf061b4b9046765a6498257b92a107c47..0795896b1e1d42a12ee8efe60a5aaad677e48532 100644 (file)
@@ -383,10 +383,11 @@ rt_new0(struct dhcpcd_ctx *ctx)
 #endif
        } else
 #endif
-       if (rt == NULL && (rt = malloc(sizeof(*rt))) == NULL)
+       if ((rt = malloc(sizeof(*rt))) == NULL) {
                logerr(__func__);
-       else
-               memset(rt, 0, sizeof(*rt));
+               return NULL;
+       }
+       memset(rt, 0, sizeof(*rt));
        return rt;
 }