From c51a26d4b681fb7656c2556cfd72b69b9019a624 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Mon, 7 Nov 2005 19:22:20 +0000 Subject: [PATCH] Fix malloc size (visible on amd64, with "kldconfig -r"). --- sbin/kldconfig/kldconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/kldconfig/kldconfig.c b/sbin/kldconfig/kldconfig.c index 6da8d530c192..403251d2a18f 100644 --- a/sbin/kldconfig/kldconfig.c +++ b/sbin/kldconfig/kldconfig.c @@ -270,7 +270,7 @@ parsepath(struct pathhead *pathq, char *path, int uniq) while ((p = strsep(&path, ";")) != NULL) if (!uniq) { - if (((pe = malloc(sizeof(pe))) == NULL) || + if (((pe = malloc(sizeof(*pe))) == NULL) || ((pe->path = strdup(p)) == NULL)) { errno = ENOMEM; err(1, "allocating path element");