Author: ngie
Date: Wed May  4 00:26:47 2016
New Revision: 299019
URL: https://svnweb.freebsd.org/changeset/base/299019

Log:
  MFstable/10 r299018:
  
  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

Modified:
  stable/9/contrib/bsnmp/snmpd/config.c
  stable/9/contrib/bsnmp/snmpd/main.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)
  stable/9/contrib/bsnmp/   (props changed)

Modified: stable/9/contrib/bsnmp/snmpd/config.c
==============================================================================
--- stable/9/contrib/bsnmp/snmpd/config.c       Wed May  4 00:25:20 2016        
(r299018)
+++ stable/9/contrib/bsnmp/snmpd/config.c       Wed May  4 00:26:47 2016        
(r299019)
@@ -1150,7 +1150,8 @@ parse_define(const char *varname)
                        free(m->value);
                        m->value = string;
                        m->length = length;
-               }
+               } else
+                       free(string);
        }
 
        token = TOK_EOL;

Modified: stable/9/contrib/bsnmp/snmpd/main.c
==============================================================================
--- stable/9/contrib/bsnmp/snmpd/main.c Wed May  4 00:25:20 2016        
(r299018)
+++ stable/9/contrib/bsnmp/snmpd/main.c Wed May  4 00:26:47 2016        
(r299019)
@@ -2813,7 +2813,7 @@ usm_new_user(uint8_t *eid, uint32_t elen
        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;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to