]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
route: revert prior change to rt_new0
authorRoy Marples <roy@marples.name>
Thu, 9 Apr 2020 20:55:33 +0000 (21:55 +0100)
committerRoy Marples <roy@marples.name>
Thu, 9 Apr 2020 20:55:33 +0000 (21:55 +0100)
src/route.c

index 125c9532e36a23d3c6c44f64e82244310e007510..401ce07c6ff82ebe3b0d8eca528566d7bd01474d 100644 (file)
@@ -349,8 +349,11 @@ rt_new0(struct dhcpcd_ctx *ctx)
 #endif
        } else
 #endif
-       if ((rt = calloc(1, sizeof(*rt))) == NULL)
+       if ((rt = malloc(sizeof(*rt))) == NULL) {
                logerr(__func__);
+               return NULL;
+       }
+       memset(rt, 0, sizeof(*rt));
        return rt;
 }