*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
pstring evtfilepath;
REGSUBKEY_CTR *subkeys;
REGVAL_CTR *values;
- uint32 uiDisplayNameId;
uint32 uiMaxSize;
uint32 uiRetention;
uint32 uiCategoryCount;
}
regdb_fetch_keys( KEY_EVENTLOG, subkeys );
regsubkey_ctr_addkey( subkeys, *elogs );
- if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) )
+ if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) ) {
+ TALLOC_FREE(subkeys);
return False;
+ }
TALLOC_FREE( subkeys );
/* add in the key of form KEY_EVENTLOG/Application */
regdb_fetch_keys( evtlogpath, subkeys );
regsubkey_ctr_addkey( subkeys, *elogs );
- if ( !regdb_store_keys( evtlogpath, subkeys ) )
+ if ( !regdb_store_keys( evtlogpath, subkeys ) ) {
+ TALLOC_FREE(subkeys);
return False;
+ }
TALLOC_FREE( subkeys );
/* now add the values to the KEY_EVENTLOG/Application form key */
/* hard code some initial values */
- uiDisplayNameId = 0x00000100;
+ /* uiDisplayNameId = 0x00000100; */
uiMaxSize = 0x00080000;
uiRetention = 0x93A80;
int i;
int numsources;
+ if (!elogs) {
+ return False;
+ }
+
for ( i = 0; elogs[i]; i++ ) {
if ( strequal( elogs[i], eventlog ) )
break;
already_in = False;
wrklist = NULL;
- dump_data( 1, (const char *)rval->data_p, rval->size );
+ dump_data( 1, rval->data_p, rval->size );
if ( ( numsources =
regval_convert_multi_sz( ( uint16 * ) rval->data_p, rval->size,
&wrklist ) ) > 0 ) {
*( wp + numsources ) = ( char * ) sourcename;
*( wp + numsources + 1 ) = NULL;
mbytes = regval_build_multi_sz( wp, &msz_wp );
- dump_data( 1, ( char * ) msz_wp, mbytes );
+ dump_data( 1, ( uint8 * ) msz_wp, mbytes );
regval_ctr_addvalue( values, "Sources", REG_MULTI_SZ,
( char * ) msz_wp, mbytes );
regdb_store_values( evtlogpath, values );
sourcename ) );
}
TALLOC_FREE( values );
- if ( wrklist )
- TALLOC_FREE( wrklist ); /* */
+ TALLOC_FREE( wrklist ); /* */
if ( !( subkeys = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR ) ) ) {
DEBUG( 0, ( "talloc() failure!\n" ) );