diff options
author | Simo Sorce <idra@samba.org> | 2001-09-17 11:48:29 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-09-17 11:48:29 +0000 |
commit | c0ef0e113e8d3117891b4b137f660ca3c4c6b1f0 (patch) | |
tree | b1a191b7c5b57921b1c3229ba8e672dcc2ce1338 /source3/utils | |
parent | 2d6a3079b805a57f5618c97fff2adda77de934f4 (diff) | |
download | samba-c0ef0e113e8d3117891b4b137f660ca3c4c6b1f0.tar.gz samba-c0ef0e113e8d3117891b4b137f660ca3c4c6b1f0.tar.bz2 samba-c0ef0e113e8d3117891b4b137f660ca3c4c6b1f0.zip |
move to SAFE_FREE()
(This used to be commit 67db8f03c5c9e81e11b5f3276b50ee23e09a2659)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/make_printerdef.c | 16 | ||||
-rw-r--r-- | source3/utils/nmblookup.c | 2 | ||||
-rw-r--r-- | source3/utils/smbcacls.c | 22 | ||||
-rw-r--r-- | source3/utils/smbpasswd.c | 12 | ||||
-rw-r--r-- | source3/utils/smbtree.c | 2 |
5 files changed, 26 insertions, 28 deletions
diff --git a/source3/utils/make_printerdef.c b/source3/utils/make_printerdef.c index bfbf6fa499..47589984cc 100644 --- a/source3/utils/make_printerdef.c +++ b/source3/utils/make_printerdef.c @@ -154,8 +154,8 @@ static void lookup_strings(FILE *fichier) temp2=(char *)malloc(sizeof(pstring)); if(temp == NULL || temp2 == NULL) { - safe_free(temp); - safe_free(temp2); + SAFE_FREE(temp); + SAFE_FREE(temp2); fprintf(stderr,"lookup_strings: malloc fail !\n"); exit(1); } @@ -218,8 +218,8 @@ static void lookup_entry(FILE *fichier,char *chaine) temp2=(char *)malloc(sizeof(pstring)); if(temp == NULL || temp2 == NULL) { - safe_free(temp); - safe_free(temp2); + SAFE_FREE(temp); + SAFE_FREE(temp2); fprintf(stderr,"lookup_entry: malloc fail !\n"); exit(1); } @@ -276,9 +276,9 @@ static char *find_desc(FILE *fichier,char *text) long_desc=(char *)malloc(sizeof(pstring)); short_desc=(char *)malloc(sizeof(pstring)); if (!chaine || !long_desc || !short_desc) { - safe_free(chaine); - safe_free(long_desc); - safe_free(short_desc); + SAFE_FREE(chaine); + SAFE_FREE(long_desc); + SAFE_FREE(short_desc); fprintf(stderr,"find_desc: Unable to malloc memory\n"); exit(1); } @@ -307,7 +307,7 @@ static char *find_desc(FILE *fichier,char *text) if (!strcmp(text,long_desc)) found=1; } - free(chaine); + SAFE_FREE(chaine); if (!found || !crap) return(NULL); while(*crap==' ') crap++; pstrcpy(short_desc,crap); diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 2d86cc0a35..ff675a72e5 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -124,7 +124,7 @@ static void do_node_status(int fd, char *name, int type, struct in_addr ip) cleanname,status[i].type, node_status_flags(status[i].flags)); } - free(status); + SAFE_FREE(status); } d_printf("\n"); } diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 914e99367b..ba5630a9d8 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -328,7 +328,7 @@ static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace) memcpy(aces, (*the_acl)->ace, (*the_acl)->num_aces * sizeof(SEC_ACE)); memcpy(aces+(*the_acl)->num_aces, ace, sizeof(SEC_ACE)); new = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces); - free(aces); + SAFE_FREE(aces); (*the_acl) = new; return True; } @@ -391,8 +391,8 @@ static SEC_DESC *sec_desc_parse(char *str) ret = make_sec_desc(ctx,revision, owner_sid, grp_sid, NULL, dacl, &sd_size); - if (grp_sid) free(grp_sid); - if (owner_sid) free(owner_sid); + SAFE_FREE(grp_sid); + SAFE_FREE(owner_sid); return ret; } @@ -605,10 +605,8 @@ static int cacl_set(struct cli_state *cli, char *filename, } old->dacl->num_aces--; if (old->dacl->num_aces == 0) { - free(old->dacl->ace); - old->dacl->ace=NULL; - free(old->dacl); - old->dacl = NULL; + SAFE_FREE(old->dacl->ace); + SAFE_FREE(old->dacl); old->off_dacl = 0; } found = True; @@ -713,14 +711,14 @@ struct cli_state *connect_one(char *share) if (!(c=cli_initialise(NULL)) || !cli_connect(c, server, &ip)) { DEBUG(0,("Connection to %s failed\n", server)); cli_shutdown(c); - safe_free(c); + SAFE_FREE(c); return NULL; } if (!cli_session_request(c, &calling, &called)) { DEBUG(0,("session request to %s failed\n", called.name)); cli_shutdown(c); - safe_free(c); + SAFE_FREE(c); if (strcmp(called.name, "*SMBSERVER")) { make_nmb_name(&called , "*SMBSERVER", 0x20); goto again; @@ -733,7 +731,7 @@ struct cli_state *connect_one(char *share) if (!cli_negprot(c)) { DEBUG(0,("protocol negotiation failed\n")); cli_shutdown(c); - safe_free(c); + SAFE_FREE(c); return NULL; } @@ -750,7 +748,7 @@ struct cli_state *connect_one(char *share) lp_workgroup())) { DEBUG(0,("session setup failed: %s\n", cli_errstr(c))); cli_shutdown(c); - safe_free(c); + SAFE_FREE(c); return NULL; } @@ -760,7 +758,7 @@ struct cli_state *connect_one(char *share) password, strlen(password)+1)) { DEBUG(0,("tree connect failed: %s\n", cli_errstr(c))); cli_shutdown(c); - safe_free(c); + SAFE_FREE(c); return NULL; } diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index da5f817c80..14b10c1700 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -491,14 +491,14 @@ static char *prompt_for_new_password(BOOL stdin_get) p = get_pass("New SMB password:", stdin_get); fstrcpy(new_passwd, p); - safe_free(p); + SAFE_FREE(p); p = get_pass("Retype new SMB password:", stdin_get); if (strcmp(p, new_passwd)) { fprintf(stderr, "Mismatch - password unchanged.\n"); ZERO_ARRAY(new_passwd); - safe_free(p); + SAFE_FREE(p); return NULL; } @@ -730,7 +730,7 @@ static int process_root(int argc, char *argv[]) } if (local_flags & LOCAL_ADD_USER) { - safe_free(new_passwd); + SAFE_FREE(new_passwd); new_passwd = xstrdup(user_name); strlower(new_passwd); } @@ -803,7 +803,7 @@ static int process_root(int argc, char *argv[]) } done: - safe_free(new_passwd); + SAFE_FREE(new_passwd); return result; } @@ -898,8 +898,8 @@ static int process_nonroot(int argc, char *argv[]) printf("Password changed for user %s\n", user_name); done: - safe_free(old_passwd); - safe_free(new_passwd); + SAFE_FREE(old_passwd); + SAFE_FREE(new_passwd); return result; } diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c index 191a9124f7..d7842d1e02 100644 --- a/source3/utils/smbtree.c +++ b/source3/utils/smbtree.c @@ -161,7 +161,7 @@ static struct cli_state *get_ipc_connect(char *server, if (cli && cli->initialised) cli_shutdown(cli); - free(cli); + SAFE_FREE(cli); return NULL; } |