Added check for NULL pointer in serviceClearRouterOptions.

This commit is contained in:
VilhoRaatikka 2014-06-05 20:17:39 +03:00
parent 515f6de742
commit 1a43a4868f

View File

@ -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);
}
/**