From e31cb18360919b0c74c607ca1d3983020b8e033f Mon Sep 17 00:00:00 2001 From: glebius 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/ifconfig') diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c index a474729..29b8574 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.1