diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -147,7 +147,9 @@ parse: while (argc > 0) { - if ((p = strdup(*argv)) == NULL) + char *orig; + + if ((orig = p = strdup(*argv)) == NULL) err(1, "strdup(%s)", *argv); /* Check if we're using the shorthand syntax for volume setting. */ @@ -200,7 +202,7 @@ /* Input: `dev.control=val`. */ cp->mod(cp->parent_dev, valstr); next: - free(p); + free(orig); argc--; argv++; }