summaryrefslogtreecommitdiff
path: root/source4/param/loadparm.c
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/param/loadparm.c
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/param/loadparm.c')
-rw-r--r--source4/param/loadparm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 334ec982e0..035ac3422a 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1576,8 +1576,7 @@ static int add_a_service(const service *pservice, const char *name)
}
else {
ServicePtrs = tsp;
- ServicePtrs[iNumServices] =
- (service *) malloc(sizeof(service));
+ ServicePtrs[iNumServices] = malloc_p(service);
}
if (!ServicePtrs[iNumServices]) {
DEBUG(0,("add_a_service: out of memory!\n"));
@@ -1871,7 +1870,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL
pdata = pdata->next;
}
if (not_added) {
- paramo = smb_xmalloc(sizeof(*paramo));
+ paramo = smb_xmalloc_p(struct param_opt);
paramo->key = strdup(data->key);
paramo->value = strdup(data->value);
DLIST_ADD(pserviceDest->param_opt, paramo);
@@ -1940,7 +1939,7 @@ static void add_to_file_list(const char *fname, const char *subfname)
}
if (!f) {
- f = (struct file_lists *)malloc(sizeof(file_lists[0]));
+ f = malloc_p(struct file_lists);
if (!f)
return;
f->next = file_lists;
@@ -2247,7 +2246,7 @@ static BOOL lp_do_parameter_parametric(int snum, const char *pszParmName, const
}
}
- paramo = smb_xmalloc(sizeof(*paramo));
+ paramo = smb_xmalloc_p(struct param_opt);
paramo->key = strdup(name);
paramo->value = strdup(pszParmValue);
paramo->flags = flags;