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");