summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_eventlog_lib.c6
-rw-r--r--source3/rpc_server/srv_eventlog_nt.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_eventlog_lib.c b/source3/rpc_server/srv_eventlog_lib.c
index e04aefa7e1..66be1dc34f 100644
--- a/source3/rpc_server/srv_eventlog_lib.c
+++ b/source3/rpc_server/srv_eventlog_lib.c
@@ -201,6 +201,12 @@ BOOL make_way_for_eventlogs( TDB_CONTEXT * the_tdb, int32 needed,
len = tdb_unpack( ret.dptr, ret.dsize, "ddddd", &reclen,
&tresv1, &trecnum, &timegen, &timewr );
+ if (len == -1) {
+ DEBUG( 10,("make_way_for_eventlogs: tdb_unpack failed.\n"));
+ tdb_unlock_bystring( the_tdb, EVT_NEXT_RECORD );
+ return False;
+ }
+
DEBUG( 8,
( "read record %d, record size is [%d], total so far [%d]\n",
i, reclen, nbytes ) );
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index c1c0b6a0e2..79839a0a52 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -289,12 +289,10 @@ Eventlog_entry *get_eventlog_record( prs_struct * ps, TDB_CONTEXT * tdb,
int srecno;
int reclen;
int len;
- uint8 *rbuff;
pstring *wpsource, *wpcomputer, *wpsid, *wpstrs, *puserdata;
key.dsize = sizeof( int32 );
- rbuff = NULL;
srecno = recno;
key.dptr = ( char * ) &srecno;