summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-04 09:30:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:20 -0500
commit2f9e170f45e128eb6ab6bd97c9c8b40dcd9a97fa (patch)
treeb16853d79b72ea2984e8c67c6f7f800ca9ff0807 /source4/lib
parentfbb5a6a0fabd3d7878f2fa95db3eef3e8504b6d2 (diff)
downloadsamba-2f9e170f45e128eb6ab6bd97c9c8b40dcd9a97fa.tar.gz
samba-2f9e170f45e128eb6ab6bd97c9c8b40dcd9a97fa.tar.bz2
samba-2f9e170f45e128eb6ab6bd97c9c8b40dcd9a97fa.zip
r4058: added a type safe version of smb_xmalloc()
(This used to be commit 1235afa5fe3a396cd7a180cbc500834a30fbaa80)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/tools/regpatch.c8
-rw-r--r--source4/lib/util_pw.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index a8b2f83ee1..9b37b7952b 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -154,7 +154,7 @@ static void print_line(struct cmd_line *cl)
*/
static struct cmd_line *get_cmd_line(int fd)
{
- struct cmd_line *cl = (CMD_LINE *)smb_xmalloc(sizeof(CMD_LINE));
+ struct cmd_line *cl = smb_xmalloc_p(CMD_LINE);
int i = 0, rc;
uint8_t ch;
@@ -445,7 +445,7 @@ static CMD *regedit4_get_cmd(int fd)
struct cmd_line *cl = NULL;
struct val_spec_list *vl = NULL;
- cmd = (struct command_s *)smb_xmalloc(sizeof(struct command_s));
+ cmd = smb_xmalloc_p(struct command_s);
cmd->cmd = CMD_NONE;
cmd->key = NULL;
@@ -488,7 +488,7 @@ static CMD *regedit4_get_cmd(int fd)
* There could be a \ on the end which we need to
* handle at some time
*/
- vl = (struct val_spec_list *)smb_xmalloc(sizeof(struct val_spec_list));
+ vl = smb_xmalloc_p(struct val_spec_list);
vl->next = NULL;
vl->val = NULL;
vl->name = parse_value(cl, &vl->type, &vl->val);
@@ -607,7 +607,7 @@ static CMD_FILE *cmd_file_create(const char *file)
return NULL;
}
- tmp = (CMD_FILE *)smb_xmalloc(sizeof(CMD_FILE));
+ tmp = smb_xmalloc_p(CMD_FILE);
/*
* Let's fill in some of the fields;
diff --git a/source4/lib/util_pw.c b/source4/lib/util_pw.c
index 9d075a05e8..19893e396f 100644
--- a/source4/lib/util_pw.c
+++ b/source4/lib/util_pw.c
@@ -24,7 +24,7 @@
static struct passwd *alloc_copy_passwd(const struct passwd *from)
{
- struct passwd *ret = smb_xmalloc(sizeof(struct passwd));
+ struct passwd *ret = smb_xmalloc_p(struct passwd);
ZERO_STRUCTP(ret);
ret->pw_name = smb_xstrdup(from->pw_name);
ret->pw_passwd = smb_xstrdup(from->pw_passwd);