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);
}
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);
}
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);
}
if (!strcmp(text,long_desc))
found=1;
}
- free(chaine);
+ SAFE_FREE(chaine);
if (!found || !crap) return(NULL);
while(*crap==' ') crap++;
pstrcpy(short_desc,crap);
cleanname,status[i].type,
node_status_flags(status[i].flags));
}
- free(status);
+ SAFE_FREE(status);
}
d_printf("\n");
}
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;
}
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;
}
}
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;
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;
if (!cli_negprot(c)) {
DEBUG(0,("protocol negotiation failed\n"));
cli_shutdown(c);
- safe_free(c);
+ SAFE_FREE(c);
return NULL;
}
lp_workgroup())) {
DEBUG(0,("session setup failed: %s\n", cli_errstr(c)));
cli_shutdown(c);
- safe_free(c);
+ SAFE_FREE(c);
return NULL;
}
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;
}
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;
}
}
if (local_flags & LOCAL_ADD_USER) {
- safe_free(new_passwd);
+ SAFE_FREE(new_passwd);
new_passwd = xstrdup(user_name);
strlower(new_passwd);
}
}
done:
- safe_free(new_passwd);
+ SAFE_FREE(new_passwd);
return result;
}
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;
}
if (cli && cli->initialised)
cli_shutdown(cli);
- free(cli);
+ SAFE_FREE(cli);
return NULL;
}
variables[num_variables].name = strdup(line);
variables[num_variables].value = strdup(p+1);
- free(line);
+ SAFE_FREE(line);
if (!variables[num_variables].name ||
!variables[num_variables].value)
if ((ip_list = name_query(fd, "__SAMBA__", 0,
True, True, loopback_ip,
&count)) != NULL) {
- free(ip_list);
+ SAFE_FREE(ip_list);
close(fd);
return True;
}