Added check for NULL pointer in serviceClearRouterOptions.
This commit is contained in:
parent
515f6de742
commit
1a43a4868f
@ -542,10 +542,13 @@ serviceClearRouterOptions(SERVICE *service)
|
||||
int i;
|
||||
|
||||
spinlock_acquire(&service->spin);
|
||||
for (i = 0; service->routerOptions[i]; i++)
|
||||
free(service->routerOptions[i]);
|
||||
free(service->routerOptions);
|
||||
service->routerOptions = NULL;
|
||||
if (service->routerOptions != NULL)
|
||||
{
|
||||
for (i = 0; service->routerOptions[i]; i++)
|
||||
free(service->routerOptions[i]);
|
||||
free(service->routerOptions);
|
||||
service->routerOptions = NULL;
|
||||
}
|
||||
spinlock_release(&service->spin);
|
||||
}
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user