Huw Davies (@huw) commented about server/registry.c:
memcmp( key_fullpath, applicationhive_fullpath, sizeof(applicationhive_fullpath) ))
- {
set_error( STATUS_PRIVILEGE_NOT_HELD );
- }
- free( key_fullpath );
- if (get_error()) return 0;
- load_registry( key, filename );
- if (get_error())
- {
delete_key( key, 1 );
return 0;
- }
- key->filename = malloc( strlen( filename ) + 1 );
- strcpy( key->filename, filename );
Use `strdup()` and test for failure.