[icinga-checkins] icinga.org: icinga-core/tdressler/oci_rewrite: refs #1366

git at icinga.org git at icinga.org
Sat Apr 2 20:04:17 CEST 2011


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

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Sat Apr  2 09:32:44 2011 +0200

refs #1366
replace malloc/sprintf with strdup because for oracle tablenames are only copied

---

 module/idoutils/src/db.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/module/idoutils/src/db.c b/module/idoutils/src/db.c
index 6cc82d7..c2ed174 100644
--- a/module/idoutils/src/db.c
+++ b/module/idoutils/src/db.c
@@ -239,10 +239,9 @@ int ido2db_db_init(ido2db_idi *idi) {
 		        case IDO2DB_DBSERVER_ORACLE:
 #ifdef USE_ORACLE /* Oracle ocilib specific */
 				/* don't allow user to set table prefix for oracle */
-        		        if ((ido2db_db_tablenames[x] = (char *) malloc(strlen(ido2db_db_rawtablenames[x])))==NULL)
+				if ((ido2db_db_tablenames[x]=strdup(ido2db_db_rawtablenames[x]))==NULL) 
                         		return IDO_ERROR;
 
-				sprintf(ido2db_db_tablenames[x], "%s", ido2db_db_rawtablenames[x]);
 #endif /* Oracle ocilib specific */
 		                break;
 		        case IDO2DB_DBSERVER_SQLITE:





More information about the icinga-checkins mailing list