From 1a43a4868f11b1b8f4bf5672d817877e4c2fa981 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Thu, 5 Jun 2014 20:17:39 +0300 Subject: [PATCH 1/2] Added check for NULL pointer in serviceClearRouterOptions. --- server/core/service.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/core/service.c b/server/core/service.c index c1b54c0af..d963987d5 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -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); } /** From 047dd5f90e885a41aa252954e670c2ae98eb5157 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Thu, 5 Jun 2014 21:09:23 +0300 Subject: [PATCH 2/2] process_config_update didn't handle filter type which caused erroneous message being printed to error log. --- server/core/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/core/config.c b/server/core/config.c index 3b5852e1d..988e263fd 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -641,7 +641,7 @@ int error_count = 0; } } else if (strcmp(type, "server") != 0 - && strcmp(type, "filter") != 0) + && strcmp(type, "filter") != 0) { LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR, @@ -1152,7 +1152,8 @@ SERVER *server; } } else if (strcmp(type, "server") != 0 && - strcmp(type, "monitor") != 0) + strcmp(type, "monitor") != 0 && + strcmp(type, "filter") != 0) { LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR,