- pstr_sprintf( evtfilepath, "%%SystemRoot%%\\system32\\config\\%s.tdb", *elogs );
- init_unistr2( &data, evtfilepath, UNI_STR_TERMINATE );
- regval_ctr_addvalue( values, "File", REG_EXPAND_SZ, ( char * ) data.buffer,
- data.uni_str_len * sizeof( uint16 ) );
- regdb_store_values( evtlogpath, values );
+ evtfilepath = talloc_asprintf(ctx,
+ "%%SystemRoot%%\\system32\\config\\%s.tdb",
+ *elogs);
+ if (!evtfilepath) {
+ TALLOC_FREE(values);
+ }
+ init_unistr2(&data, evtfilepath, UNI_STR_TERMINATE);
+ regval_ctr_addvalue(values, "File", REG_EXPAND_SZ, (char *)data.buffer,
+ data.uni_str_len * sizeof(uint16));
+ regdb_store_values(evtlogpath, values);