summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-24 15:49:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:00 -0500
commit8387af752f81e26f1c141f6053bf6d106f0af5eb (patch)
tree9a955a18a1c25f22d4520869ea2d889a2279c03d
parentb69ca6c597b6bc80ea1abe8f1d3ca6ce2f7729d7 (diff)
downloadsamba-8387af752f81e26f1c141f6053bf6d106f0af5eb.tar.gz
samba-8387af752f81e26f1c141f6053bf6d106f0af5eb.tar.bz2
samba-8387af752f81e26f1c141f6053bf6d106f0af5eb.zip
r7880: fix a typo and memleak on failures cases (patch from marcin)
(This used to be commit 6ff0fa0b4385481f2212047d80ca17b55d996def)
-rw-r--r--source3/rpc_parse/parse_eventlog.c6
-rw-r--r--source3/rpc_server/srv_eventlog.c2
-rw-r--r--source3/rpc_server/srv_eventlog_nt.c6
3 files changed, 10 insertions, 4 deletions
diff --git a/source3/rpc_parse/parse_eventlog.c b/source3/rpc_parse/parse_eventlog.c
index d27761ad0f..734f52fffb 100644
--- a/source3/rpc_parse/parse_eventlog.c
+++ b/source3/rpc_parse/parse_eventlog.c
@@ -33,7 +33,7 @@ BOOL eventlog_io_q_open_eventlog(const char *desc, EVENTLOG_Q_OPEN_EVENTLOG *q_u
if(q_u == NULL)
return False;
- /* Data format seems to be:
+ /** Data format seems to be:
UNKNOWN structure
uint32 unknown
uint16 unknown
@@ -258,7 +258,7 @@ BOOL eventlog_io_q_read_eventlog(const char *desc, EVENTLOG_Q_READ_EVENTLOG *q_u
return True;
}
-/* Structure of response seems to be:
+/** Structure of response seems to be:
DWORD num_bytes_in_resp -- MUST be the same as q_u->max_read_size
for i=0..n
EVENTLOGRECORD record
@@ -397,7 +397,7 @@ BOOL eventlog_io_r_read_eventlog(const char *desc,
return True;
}
-/* The windows client seems to be doing something funny with the file name
+/** The windows client seems to be doing something funny with the file name
A call like
ClearEventLog(handle, "backup_file")
on the client side will result in the backup file name looking like this on the
diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c
index 07aebcd2fa..65b10e8fe4 100644
--- a/source3/rpc_server/srv_eventlog.c
+++ b/source3/rpc_server/srv_eventlog.c
@@ -185,7 +185,7 @@ static BOOL api_eventlog_clear_eventlog(pipes_struct *p)
struct api_struct api_eventlog_cmds[] =
{
{"EVENTLOG_OPENEVENTLOG", EVENTLOG_OPENEVENTLOG, api_eventlog_open_eventlog },
- {"EVENTLOG_CLOSEVENTLOG", EVENTLOG_CLOSEEVENTLOG, api_eventlog_close_eventlog },
+ {"EVENTLOG_CLOSEEVENTLOG", EVENTLOG_CLOSEEVENTLOG, api_eventlog_close_eventlog },
{"EVENTLOG_GETNUMRECORDS", EVENTLOG_GETNUMRECORDS, api_eventlog_get_num_records },
{"EVENTLOG_GETOLDESTENTRY", EVENTLOG_GETOLDESTENTRY, api_eventlog_get_oldest_entry },
{"EVENTLOG_READEVENTLOG", EVENTLOG_READEVENTLOG, api_eventlog_read_eventlog },
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index ea7512b58d..3c6e9a100f 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -169,12 +169,18 @@ WERROR _eventlog_open_eventlog(pipes_struct *p,
DEBUG(10, ("_eventlog_open_eventlog: Using [%s] as the source log file.\n", info->source_log_file_name));
if(!create_policy_hnd(p, &(r_u->handle), free_eventlog_info, (void *)info))
+ {
+ free_eventlog_info(info);
return WERR_NOMEM;
+ }
policy_handle_to_string(&r_u->handle, &info->handle_string);
if(!(_eventlog_open_eventlog_hook(info)))
+ {
+ close_policy_hnd(p, &r_u->handle);
return WERR_BADFILE;
+ }
return WERR_OK;
}