summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-20 10:56:14 -0800
committerJeremy Allison <jra@samba.org>2008-11-20 10:56:14 -0800
commit98bf3ee2f614cf89ab4920c69d2872b6d786c4b0 (patch)
treef815c7c0bcf691d6b25ea6c05fc87de125e67cfb /source3/rpc_server
parent53903d9eb1e50a98ff5fae305a1f74fc9ae73143 (diff)
downloadsamba-98bf3ee2f614cf89ab4920c69d2872b6d786c4b0.tar.gz
samba-98bf3ee2f614cf89ab4920c69d2872b6d786c4b0.tar.bz2
samba-98bf3ee2f614cf89ab4920c69d2872b6d786c4b0.zip
Second part of fix for bug #5891 - smbd crashed when viewing the eventlog exported by "eventlog list". Don't leak memory on error paths.
Jeremy.
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_eventlog_nt.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index 612db1c469..4ff10390f7 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -433,7 +433,7 @@ static bool sync_eventlog_params( EVENTLOG_INFO *info )
if ( !info->etdb ) {
DEBUG( 4, ( "No open tdb! (%s)\n", info->logname ) );
- return False;
+ goto done;
}
/* set resonable defaults. 512Kb on size and 1 week on time */
@@ -447,7 +447,7 @@ static bool sync_eventlog_params( EVENTLOG_INFO *info )
path = talloc_asprintf(ctx, "%s/%s", KEY_EVENTLOG, elogname );
if (!path) {
- return false;
+ goto done;
}
wresult = reg_open_path(ctx, path, REG_KEY_READ, get_root_nt_token(),
@@ -457,14 +457,13 @@ static bool sync_eventlog_params( EVENTLOG_INFO *info )
DEBUG( 4,
( "sync_eventlog_params: Failed to open key [%s] (%s)\n",
path, win_errstr( wresult ) ) );
- return false;
+ goto done;
}
wresult = reg_queryvalue(key, key, "Retention", &value);
if (!W_ERROR_IS_OK(wresult)) {
DEBUG(4, ("Failed to query value \"Retention\": %s\n",
win_errstr(wresult)));
- ret = false;
goto done;
}
uiRetention = value->v.dword;
@@ -473,7 +472,6 @@ static bool sync_eventlog_params( EVENTLOG_INFO *info )
if (!W_ERROR_IS_OK(wresult)) {
DEBUG(4, ("Failed to query value \"MaxSize\": %s\n",
win_errstr(wresult)));
- ret = false;
goto done;
}
uiMaxSize = value->v.dword;