summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_spoolss.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-06-01 17:01:34 +0000
committerJeremy Allison <jra@samba.org>2000-06-01 17:01:34 +0000
commitf0080e5a3979fac94d6668cf6ee9d9f61302839c (patch)
treeac4f4389195913c5a8241b25671e85a7af3b417e /source3/rpc_parse/parse_spoolss.c
parent136544268460e56d7b551ae9efac9dc0a6b2830e (diff)
downloadsamba-f0080e5a3979fac94d6668cf6ee9d9f61302839c.tar.gz
samba-f0080e5a3979fac94d6668cf6ee9d9f61302839c.tar.bz2
samba-f0080e5a3979fac94d6668cf6ee9d9f61302839c.zip
Getting back to a compilable state (not there yet but close).
Added patches for random -> sys_random. Added set_effective_xxx patches for AFS code. Memory allocation changes in spoolss code. Jeremy. (This used to be commit c2099cfb033c2cdb6035f4f7f50ce21b98e1584d)
Diffstat (limited to 'source3/rpc_parse/parse_spoolss.c')
-rw-r--r--source3/rpc_parse/parse_spoolss.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 2c562219ba..db86695365 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -1541,10 +1541,7 @@ static BOOL new_smb_io_relsecdesc(char *desc, NEW_BUFFER *buffer, int depth,
prs_set_offset(ps, buffer->string_at_end + buffer->struct_start);
/* read the sd */
- *secdesc = g_new(SEC_DESC, 1);
- if (*secdesc == NULL)
- return False;
- if (!sec_io_desc(desc, *secdesc, ps, depth))
+ if (!sec_io_desc(desc, secdesc, ps, depth))
return False;
prs_set_offset(ps, old_offset);
@@ -4747,8 +4744,7 @@ BOOL spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int de
void free_devmode(DEVICEMODE *devmode)
{
- if (devmode!=NULL)
- {
+ if (devmode!=NULL) {
if (devmode->private!=NULL)
free(devmode->private);
free(devmode);
@@ -4757,25 +4753,20 @@ void free_devmode(DEVICEMODE *devmode)
void free_printer_info_3(PRINTER_INFO_3 *printer)
{
- if (printer!=NULL)
- {
- free_sec_desc(&printer->sec);
+ if (printer!=NULL) {
+ if (printer->sec != NULL)
+ free_sec_desc(&printer->sec);
free(printer);
}
}
void free_printer_info_2(PRINTER_INFO_2 *printer)
{
- if (printer!=NULL)
- {
+ if (printer!=NULL) {
free_devmode(printer->devmode);
printer->devmode = NULL;
if (printer->secdesc != NULL)
- {
- free_sec_desc(printer->secdesc);
- free(printer->secdesc);
- printer->secdesc = NULL;
- }
+ free_sec_desc(&printer->secdesc);
free(printer);
}
}
@@ -4783,16 +4774,11 @@ void free_printer_info_2(PRINTER_INFO_2 *printer)
static PRINTER_INFO_2 *prt2_dup(const PRINTER_INFO_2* from)
{
PRINTER_INFO_2 *copy = (PRINTER_INFO_2 *)malloc(sizeof(PRINTER_INFO_2));
- if (copy != NULL)
- {
+ if (copy != NULL) {
if (from != NULL)
- {
memcpy(copy, from, sizeof(*copy));
- }
else
- {
ZERO_STRUCTP(copy);
- }
}
return copy;
}