[icinga-checkins] icinga.org: icinga-core/tdressler/sqlite: idoutils: fix doubled freed buffers causing SIGSEG introduced with #3945

git at icinga.org git at icinga.org
Wed Apr 10 22:27:46 CEST 2013


Module: icinga-core
Branch: tdressler/sqlite
Commit: 882078f8da1827f39e9ee51af93b9ec39aed6236
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=882078f8da1827f39e9ee51af93b9ec39aed6236

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Wed Apr 10 21:33:10 2013 +0200

idoutils: fix doubled freed buffers causing SIGSEG introduced with #3945
refs #3945

---

 module/idoutils/src/dbhandlers.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/module/idoutils/src/dbhandlers.c b/module/idoutils/src/dbhandlers.c
index 667152a..79914d8 100644
--- a/module/idoutils/src/dbhandlers.c
+++ b/module/idoutils/src/dbhandlers.c
@@ -5024,7 +5024,6 @@ int ido2db_handle_configfilevariables(ido2db_idi *idi, int configfile_type) {
                     result = ido2db_db_query(idi, buf1);
                 	dbi_result_free(idi->dbinfo.dbi_result);
                 	idi->dbinfo.dbi_result = NULL;
-                	first=1; //prevent reexecuting
                 	break;
                 case IDO2DB_DBSERVER_PGSQL:
 	                if (asprintf(&buf1, "%s%s(%lu, %lu, E'%s', E'%s')",
@@ -5080,7 +5079,6 @@ int ido2db_handle_configfilevariables(ido2db_idi *idi, int configfile_type) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		       	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -5331,7 +5329,6 @@ int ido2db_handle_runtimevariables(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		       	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -5763,7 +5760,6 @@ int ido2db_handle_hostdefinition(ido2db_idi *idi) {
 				    case IDO2DB_DBSERVER_SQLITE3:
 				       	//do not execute again
 				       	first=1;
-				       	if (buf1 != NULL) free(buf1);
 				       	break;
 				    default:
 				       	first = 0;
@@ -5923,7 +5919,6 @@ int ido2db_handle_hostdefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 	       	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -6058,6 +6053,7 @@ int ido2db_handle_hostdefinition(ido2db_idi *idi) {
 		             member_id
 		            ) == -1)
 					buf1 = NULL;
+				break;
 		}
 #endif
 #ifdef USE_ORACLE /* Oracle ocilib specific */
@@ -6077,7 +6073,6 @@ int ido2db_handle_hostdefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -6314,7 +6309,6 @@ int ido2db_handle_hostgroupdefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -6708,7 +6702,6 @@ int ido2db_handle_servicedefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -6863,7 +6856,6 @@ int ido2db_handle_servicedefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -7114,7 +7106,6 @@ int ido2db_handle_servicegroupdefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		      	first = 0;
@@ -7748,7 +7739,6 @@ int ido2db_handle_timeperiodefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;
@@ -8272,7 +8262,6 @@ int ido2db_handle_contactgroupdefinition(ido2db_idi *idi) {
 		    case IDO2DB_DBSERVER_SQLITE3:
 		   	//do not execute again
 		       	first=1;
-		       	if (buf1 != NULL) free(buf1);
 		       	break;
 		    default:
 		       	first = 0;





More information about the icinga-checkins mailing list