From ab210b805744a5a2ce46c1791d18f6f2ed5898a6 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 25 Apr 2013 16:34:04 +0000 Subject: Don't free memory that is going to be used as error string. PR: bin/178121 Submitted by: Garrett Cooper --- sbin/ifconfig/iflagg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c index a4747298019e..29b8574f4b1a 100644 --- a/sbin/ifconfig/iflagg.c +++ b/sbin/ifconfig/iflagg.c @@ -98,10 +98,8 @@ setlagghash(const char *val, int d, int s, const struct afswtch *afp) rf.rf_flags |= LAGG_F_HASHL3; else if (strcmp(tok, "l4") == 0) rf.rf_flags |= LAGG_F_HASHL4; - else { - free(str); + else errx(1, "Invalid lagghash option: %s", tok); - } } free(str); if (rf.rf_flags == 0) -- cgit v1.2.3