diff options
author | ngie <ngie@FreeBSD.org> | 2016-05-04 00:25:20 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-05-04 00:25:20 +0000 |
commit | 2a062cd701612c43c2847135646eb984789b4396 (patch) | |
tree | 4078674eb17724ca86217029cab6ec61ba2ed517 | |
parent | 26e1356c454fe50e6d61b6c919afb942ce8182c3 (diff) | |
download | FreeBSD-src-2a062cd701612c43c2847135646eb984789b4396.zip FreeBSD-src-2a062cd701612c43c2847135646eb984789b4396.tar.gz |
MFC r298448,r298464:
r298448:
Don't leak `string` in parse_define(..) when a macro has been found
and the parser token != TOK_ASSIGN
CID: 1007187, 1007188
Obtained from: Isilon OneFS (part of r445479)
r298464:
Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with
the rest of the users in the file
No functional change
-rw-r--r-- | contrib/bsnmp/snmpd/config.c | 3 | ||||
-rw-r--r-- | contrib/bsnmp/snmpd/main.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/contrib/bsnmp/snmpd/config.c b/contrib/bsnmp/snmpd/config.c index c4f1188..ff82e82 100644 --- a/contrib/bsnmp/snmpd/config.c +++ b/contrib/bsnmp/snmpd/config.c @@ -1150,7 +1150,8 @@ parse_define(const char *varname) free(m->value); m->value = string; m->length = length; - } + } else + free(string); } token = TOK_EOL; diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c index cbd1893..2d60926 100644 --- a/contrib/bsnmp/snmpd/main.c +++ b/contrib/bsnmp/snmpd/main.c @@ -2813,7 +2813,7 @@ usm_new_user(uint8_t *eid, uint32_t elen, char *uname) if ((uuser = (struct usm_user *)malloc(sizeof(*uuser))) == NULL) return (NULL); - memset(uuser, 0, sizeof(struct usm_user)); + memset(uuser, 0, sizeof(*uuser)); strlcpy(uuser->suser.sec_name, uname, SNMP_ADM_STR32_SIZ); memcpy(uuser->user_engine_id, eid, elen); uuser->user_engine_len = elen; |