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; int i;
spinlock_acquire(&service->spin); spinlock_acquire(&service->spin);
for (i = 0; service->routerOptions[i]; i++) if (service->routerOptions != NULL)
free(service->routerOptions[i]); {
free(service->routerOptions); for (i = 0; service->routerOptions[i]; i++)
service->routerOptions = NULL; free(service->routerOptions[i]);
free(service->routerOptions);
service->routerOptions = NULL;
}
spinlock_release(&service->spin); spinlock_release(&service->spin);
} }
/** /**