As prs_alloc_mem now zeros memory, remove superfluous memsets after it.
authorJeremy Allison <jra@samba.org>
Tue, 27 Feb 2001 02:18:37 +0000 (02:18 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 27 Feb 2001 02:18:37 +0000 (02:18 +0000)
Jeremy.
(This used to be commit 94fdffb3557fa68d634d6c402751f5bcb1f6a656)

source3/rpc_parse/parse_prs.c
source3/rpc_parse/parse_sec.c
source3/rpc_parse/parse_srv.c

index 6f23058c1db432fea86ee478358a90c254aeadf6..56d03daf18f32d7bc8bdf3a0e4b603ebd22e953f 100644 (file)
@@ -584,7 +584,6 @@ BOOL prs_buffer5(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER5 *
                str->buffer = (uint16 *)prs_alloc_mem(ps,str->buf_len * sizeof(uint16));
                if (str->buffer == NULL)
                        return False;
-               memset(str->buffer, '\0', str->buf_len * sizeof(uint16));
        }
 
        /* If the string is empty, we don't have anything to stream */
@@ -678,7 +677,6 @@ BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *
                str->buffer = (uint16 *)prs_alloc_mem(ps,str->uni_max_len * sizeof(uint16));
                if (str->buffer == NULL)
                        return False;
-               memset(str->buffer, '\0', str->uni_max_len * sizeof(uint16));
        }
 
        /* If the string is empty, we don't have anything to stream */
index 1e83b175cce018f0b53e0cdb9d301d88a8e8af65..fa0be04cba1adfef7d52053d8708465f87340b01 100644 (file)
@@ -206,7 +206,6 @@ BOOL sec_io_acl(char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth)
                 */
                if((psa = (SEC_ACL *)malloc(sizeof(SEC_ACL))) == NULL)
                        return False;
-               ZERO_STRUCTP(psa);
                *ppsa = psa;
        }
 
@@ -231,7 +230,6 @@ BOOL sec_io_acl(char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth)
                /* reading */
                if((psa->ace = malloc(sizeof(psa->ace[0]) * psa->num_aces)) == NULL)
                        return False;
-               ZERO_STRUCTP(psa->ace);
        }
 
        for (i = 0; i < psa->num_aces; i++) {
@@ -633,7 +631,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth)
                if(UNMARSHALLING(ps)) {
                        if((psd = (SEC_DESC *)malloc(sizeof(SEC_DESC))) == NULL)
                                return False;
-                       ZERO_STRUCTP(psd);
                        *ppsd = psd;
                } else {
                        /* Marshalling - just ignore. */
@@ -678,7 +675,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth)
                        /* reading */
                        if((psd->owner_sid = malloc(sizeof(*psd->owner_sid))) == NULL)
                                return False;
-                       ZERO_STRUCTP(psd->owner_sid);
                }
 
                if(!smb_io_dom_sid("owner_sid ", psd->owner_sid , ps, depth))
@@ -697,7 +693,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth)
                                return False;
                        if((psd->grp_sid = malloc(sizeof(*psd->grp_sid))) == NULL)
                                return False;
-                       ZERO_STRUCTP(psd->grp_sid);
                }
 
                if(!smb_io_dom_sid("grp_sid", psd->grp_sid, ps, depth))
@@ -810,7 +805,6 @@ BOOL sec_io_desc_buf(char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int depth
        if (UNMARSHALLING(ps) && psdb == NULL) {
                if((psdb = (SEC_DESC_BUF *)malloc(sizeof(SEC_DESC_BUF))) == NULL)
                        return False;
-               ZERO_STRUCTP(psdb);
                *ppsdb = psdb;
        }
 
index 1721b6f187b7ffbdf81bdcb048cc96cbd9b481f8..3db3161ed596e2aec2b7f3a69e2a856bb0e33a01 100644 (file)
@@ -293,7 +293,6 @@ static BOOL srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct
                if (UNMARSHALLING(ps)) {
                        if (!(info1 = (SRV_SHARE_INFO_1 *)prs_alloc_mem(ps, num_entries * sizeof(SRV_SHARE_INFO_1))))
                                return False;
-                       memset(info1, '\0', num_entries * sizeof(SRV_SHARE_INFO_1));
                        ctr->share.info1 = info1;
                }
 
@@ -319,7 +318,6 @@ static BOOL srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct
                if (UNMARSHALLING(ps)) {
                        if (!(info2 = (SRV_SHARE_INFO_2 *)prs_alloc_mem(ps,num_entries * sizeof(SRV_SHARE_INFO_2))))
                                return False;
-                       memset(info2, '\0', num_entries * sizeof(SRV_SHARE_INFO_2));
                        ctr->share.info2 = info2;
                }
 
@@ -807,7 +805,6 @@ static BOOL srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR **pp_ctr, prs_stru
                ctr = *pp_ctr = (SRV_SESS_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_SESS_INFO_CTR));
                if (ctr == NULL)
                        return False;
-               ZERO_STRUCTP(ctr);
        }
 
        if (ctr == NULL)
@@ -1173,7 +1170,6 @@ static BOOL srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR **pp_ctr, prs_stru
                ctr = *pp_ctr = (SRV_CONN_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_CONN_INFO_CTR));
                if (ctr == NULL)
                        return False;
-               ZERO_STRUCTP(ctr);
        }
                
        if (ctr == NULL)
@@ -1453,7 +1449,6 @@ static BOOL srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR **pp_ctr, prs_stru
                ctr = *pp_ctr = (SRV_FILE_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_FILE_INFO_CTR));
                if (ctr == NULL)
                        return False;
-               ZERO_STRUCTP(ctr);
        }
 
        if (ctr == NULL)