Don't try to free string (stack allocated char[])

Fix minor style with warnx call while in the neighborhood

MFC after: 1 week
CID: 1009683
Reported by: Coverity, gcc 5.x
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-04-22 06:01:11 +00:00
parent 81b3868083
commit 9899399c06

View file

@ -1079,10 +1079,9 @@ snmp_oid2asn_oid(struct snmp_toolinfo *snmptoolctx, char *str,
strlcpy(string, str, i + 1);
string[i] = '\0';
if (snmp_lookup_enumoid(snmptoolctx, &obj, string) < 0) {
warnx("Unknown string - %s",string);
warnx("Unknown string - %s", string);
return (NULL);
}
free(string);
}
asn_append_oid(oid, &(obj.val.var));