icinga (1.0.2-2) 91_fix-copy-paste-error-569.dpatch

Summary

 base/config.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 91_fix-copy-paste-error-569.dpatch by Christoph Maser <cmr@financial.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Don't overwrite temp_path if it is before check_result_path in config

@DPATCH@


diff --git a/base/config.c b/base/config.c
index a2ec628..104853d 100644
--- a/base/config.c
+++ b/base/config.c
@@ -446,16 +446,13 @@ int read_main_config_file(char *main_config_file){
 				}
 			closedir(tmpdir);
 
-			my_free(temp_path);
-			if((temp_path=(char *)strdup(value))){
-				strip(temp_path);
+			my_free(check_result_path);
+			if((check_result_path=(char *)strdup(value))){
+				strip(check_result_path);
 				/* make sure we don't have a trailing slash */
-				if(temp_path[strlen(temp_path)-1]=='/')
-					temp_path[strlen(temp_path)-1]='\x0';
+				if(check_result_path[strlen(check_result_path)-1]=='/')
+					check_result_path[strlen(check_result_path)-1]='\x0';
 			        }
-
-			my_free(check_result_path);
-			check_result_path=(char *)strdup(temp_path);
 			}
 
 		else if(!strcmp(variable,"max_check_result_file_age"))
-- 
1.7.1