services: Handle realloc failures better (Coverity).
This commit is contained in:
parent
45a1269013
commit
2c7ac13662
|
@ -242,10 +242,12 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
|
||||||
{
|
{
|
||||||
if (i+1 >= size)
|
if (i+1 >= size)
|
||||||
{
|
{
|
||||||
|
struct service_entry **slist_new;
|
||||||
size *= 2;
|
size *= 2;
|
||||||
services_list = HeapReAlloc(GetProcessHeap(), 0, services_list, size * sizeof(services_list[0]));
|
slist_new = HeapReAlloc(GetProcessHeap(), 0, services_list, size * sizeof(services_list[0]));
|
||||||
if (!services_list)
|
if (!slist_new)
|
||||||
break;
|
break;
|
||||||
|
services_list = slist_new;
|
||||||
}
|
}
|
||||||
services_list[i] = service;
|
services_list[i] = service;
|
||||||
service->ref_count++;
|
service->ref_count++;
|
||||||
|
|
Loading…
Reference in New Issue