fix crash when registry file is not opened

This commit is contained in:
Jay Sorg 2011-07-25 13:50:00 -07:00
parent ef9788a0a1
commit 5f7b50f902

View File

@ -86,6 +86,11 @@ void registry_print(rdpRegistry* registry, FILE* fp)
void registry_create(rdpRegistry* registry)
{
registry->fp = fopen(registry->file, "w+");
if (registry->fp == NULL)
{
printf("registry_create: error opening [%s] for writing\n", registry->file);
return;
}
registry_print(registry, registry->fp);
fflush(registry->fp);
}