services: Handle realloc failures better (Coverity).

This commit is contained in:
Marcus Meissner 2009-01-31 11:44:12 +01:00 committed by Alexandre Julliard
parent 45a1269013
commit 2c7ac13662
1 changed files with 4 additions and 2 deletions

View File

@ -242,10 +242,12 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
{
if (i+1 >= size)
{
struct service_entry **slist_new;
size *= 2;
services_list = HeapReAlloc(GetProcessHeap(), 0, services_list, size * sizeof(services_list[0]));
if (!services_list)
slist_new = HeapReAlloc(GetProcessHeap(), 0, services_list, size * sizeof(services_list[0]));
if (!slist_new)
break;
services_list = slist_new;
}
services_list[i] = service;
service->ref_count++;