[med-svn] [conquest-dicom-server] 07/14: Fix cppcheck bugs 8 and 9 - Reviewed by Marcel

Pablo Lorenzzoni spectra at moszumanska.debian.org
Tue Mar 11 17:55:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

spectra pushed a commit to branch master
in repository conquest-dicom-server.

commit ccf52a907d9184b6d128efe09266ab48b86de4ec
Author: Pablo Lorenzzoni <spectra at debian.org>
Date:   Wed Mar 5 17:37:05 2014 -0300

    Fix cppcheck bugs 8 and 9 - Reviewed by Marcel
---
 ...k-bug-1.patch => 0008-Fix-cppcheck-bug-1.patch} |  0
 debian/patches/0008-Fix-cppcheck-bug-6.patch       | 26 ------------
 ...k-bug-4.patch => 0009-Fix-cppcheck-bug-4.patch} |  2 +-
 ...ppcheck-bug-3-and-others-in-same-function.patch | 46 ----------------------
 ...g-5.5.patch => 0010-Fix-cppcheck-bug-5.5.patch} |  2 +-
 ...Patch-mismatches-new-delete-in-flpdu.cxx.patch} |  0
 ...-cppcheck-bugs-8-and-9-Reviewed-by-Marcel.patch | 30 ++++++++++++++
 debian/patches/0013-Fix-cppcheck-bugs-8-e-9.patch  | 42 --------------------
 debian/patches/series                              |  9 +++--
 9 files changed, 37 insertions(+), 120 deletions(-)

diff --git a/debian/patches/0009-Fix-cppcheck-bug-1.patch b/debian/patches/0008-Fix-cppcheck-bug-1.patch
similarity index 100%
rename from debian/patches/0009-Fix-cppcheck-bug-1.patch
rename to debian/patches/0008-Fix-cppcheck-bug-1.patch
diff --git a/debian/patches/0008-Fix-cppcheck-bug-6.patch b/debian/patches/0008-Fix-cppcheck-bug-6.patch
deleted file mode 100644
index 6afd322..0000000
--- a/debian/patches/0008-Fix-cppcheck-bug-6.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Pablo Lorenzzoni <spectra at debian.org>
-Date: Tue, 4 Feb 2014 17:40:17 -0200
-Subject: Fix cppcheck bug #6
-
-[dgate.cpp:5955]: (error) Array 'items[4]' index 4 out of bounds
----
- dgate.cpp |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/dgate.cpp b/dgate.cpp
-index cc440aa..2dce88e 100644
---- a/dgate.cpp
-+++ b/dgate.cpp
-@@ -5951,10 +5951,10 @@ extern "C"
-     const char *items[4];
-     SQLLEN SQLResultLength;
-     for (i=0; i<4; i++) items[i]=lua_tostring(L,i+1);
--    if (items[1]) for (i=0; i<strlen(items[1]); i++) if (items[1][i]==',') flds++;
-+    if (items[0]) for (i=0; i<strlen(items[0]); i++) if (items[0][i]==',') flds++;
-+    if (items[1]) if (*items[1]==0) items[1]=NULL;
-     if (items[2]) if (*items[2]==0) items[2]=NULL;
-     if (items[3]) if (*items[3]==0) items[3]=NULL;
--    if (items[4]) if (*items[4]==0) items[4]=NULL;
- 
-     Database DB;
-     if (DB.Open ( DataSource, UserName, Password, DataHost ) )
diff --git a/debian/patches/0011-Fix-cppcheck-bug-4.patch b/debian/patches/0009-Fix-cppcheck-bug-4.patch
similarity index 94%
rename from debian/patches/0011-Fix-cppcheck-bug-4.patch
rename to debian/patches/0009-Fix-cppcheck-bug-4.patch
index 0841ad4..e5d999e 100644
--- a/debian/patches/0011-Fix-cppcheck-bug-4.patch
+++ b/debian/patches/0009-Fix-cppcheck-bug-4.patch
@@ -8,7 +8,7 @@ Subject: Fix cppcheck bug #4
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/device.cpp b/device.cpp
-index 2b07c7c..3afb058 100644
+index 02cf3cd..d128c04 100644
 --- a/device.cpp
 +++ b/device.cpp
 @@ -781,7 +781,8 @@ CheckFreeStoreOnCACHEDevice(
diff --git a/debian/patches/0010-Fix-cppcheck-bug-3-and-others-in-same-function.patch b/debian/patches/0010-Fix-cppcheck-bug-3-and-others-in-same-function.patch
deleted file mode 100644
index 3170b6a..0000000
--- a/debian/patches/0010-Fix-cppcheck-bug-3-and-others-in-same-function.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Pablo Lorenzzoni <spectra at debian.org>
-Date: Wed, 5 Feb 2014 11:54:40 +0000
-Subject: Fix cppcheck bug #3 (and others in same function)
-
-[device.cpp:2897]: (error) Memory leak: PatList
----
- device.cpp |    8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/device.cpp b/device.cpp
-index 02cf3cd..2b07c7c 100644
---- a/device.cpp
-+++ b/device.cpp
-@@ -2894,10 +2894,16 @@ MakeListOfPatientsOnDevice(char *Device, char **PatientIDList)
- 		if (PatList==NULL) return -1;
- 
- 		if (!DB.QueryDistinct(PatientTableName, "PatientID", "", "DICOMPatients.AccessTime"))
-+			{
-+			free(PatList);
- 			return -1;
-+			}
- 
- 		if(!DB.BindField (1, SQL_C_CHAR, PatientID, 68, &sdword))
-+			{
-+			free(PatList);
- 			return -1;
-+			}
- 
- 		NPat = 0;
- 		while(DB.NextRecord())
-@@ -2944,6 +2950,7 @@ MakeListOfPatientsOnDevice(char *Device, char **PatientIDList)
- 			}
- 
- 		free (PatList);
-+		free (PatientIDList);
- 		DB.Close();
- 		return Patients;
- 		}
-@@ -2985,6 +2992,7 @@ MakeListOfPatientsOnDevice(char *Device, char **PatientIDList)
- 		}
- 
- 	DB.Close();
-+	free(PatientIDList);
- 	return Patients;
- 	}
- 
diff --git a/debian/patches/0012-Fix-cppcheck-bug-5.5.patch b/debian/patches/0010-Fix-cppcheck-bug-5.5.patch
similarity index 95%
rename from debian/patches/0012-Fix-cppcheck-bug-5.5.patch
rename to debian/patches/0010-Fix-cppcheck-bug-5.5.patch
index 59dd429..41faee3 100644
--- a/debian/patches/0012-Fix-cppcheck-bug-5.5.patch
+++ b/debian/patches/0010-Fix-cppcheck-bug-5.5.patch
@@ -8,7 +8,7 @@ Subject: Fix cppcheck bug #5.5
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/dgate.cpp b/dgate.cpp
-index 2dce88e..ff462b2 100644
+index cc440aa..7aca6a0 100644
 --- a/dgate.cpp
 +++ b/dgate.cpp
 @@ -6503,7 +6503,7 @@ extern "C"
diff --git a/debian/patches/0014-Patch-mismatches-new-delete-in-flpdu.cxx.patch b/debian/patches/0011-Patch-mismatches-new-delete-in-flpdu.cxx.patch
similarity index 100%
rename from debian/patches/0014-Patch-mismatches-new-delete-in-flpdu.cxx.patch
rename to debian/patches/0011-Patch-mismatches-new-delete-in-flpdu.cxx.patch
diff --git a/debian/patches/0012-Fix-cppcheck-bugs-8-and-9-Reviewed-by-Marcel.patch b/debian/patches/0012-Fix-cppcheck-bugs-8-and-9-Reviewed-by-Marcel.patch
new file mode 100644
index 0000000..46e84c1
--- /dev/null
+++ b/debian/patches/0012-Fix-cppcheck-bugs-8-and-9-Reviewed-by-Marcel.patch
@@ -0,0 +1,30 @@
+From: Pablo Lorenzzoni <spectra at debian.org>
+Date: Wed, 5 Mar 2014 17:35:22 -0300
+Subject: Fix cppcheck bugs 8 and 9 - Reviewed by Marcel
+
+---
+ dgate.cpp |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dgate.cpp b/dgate.cpp
+index 7aca6a0..6a8c109 100644
+--- a/dgate.cpp
++++ b/dgate.cpp
+@@ -5976,7 +5976,7 @@ extern "C"
+   }
+   static int luasql(lua_State *L)
+   { const char *sql = lua_tostring(L,1);
+-    BOOL f;
++    BOOL f = FALSE;
+ 
+     Database DB;
+     if (DB.Open ( DataSource, UserName, Password, DataHost ) )
+@@ -6410,7 +6410,7 @@ extern "C"
+   static int luadeletedicomobject(lua_State *L)
+   { struct scriptdata *sd = getsd(L);
+     DICOMDataObject *O = NULL;
+-    int owned;
++    int owned = 0;
+     Array < DICOMDataObject * > *A = NULL;
+     if (lua_isuserdata(L,1)) 
+     { lua_getmetatable(L, 1);
diff --git a/debian/patches/0013-Fix-cppcheck-bugs-8-e-9.patch b/debian/patches/0013-Fix-cppcheck-bugs-8-e-9.patch
deleted file mode 100644
index d238164..0000000
--- a/debian/patches/0013-Fix-cppcheck-bugs-8-e-9.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Pablo Lorenzzoni <spectra at debian.org>
-Date: Wed, 5 Feb 2014 16:57:49 -0200
-Subject: Fix cppcheck bugs #8 e #9
-
-[dgate.cpp:5985]: (error) Uninitialized variable: f
-[dgate.cpp:6422]: (error) Uninitialized variable: owned
----
- dgate.cpp |   13 ++++++-------
- 1 file changed, 6 insertions(+), 7 deletions(-)
-
-diff --git a/dgate.cpp b/dgate.cpp
-index ff462b2..ea22a30 100644
---- a/dgate.cpp
-+++ b/dgate.cpp
-@@ -5983,13 +5983,12 @@ extern "C"
-     { f = DB.Exec(sql);
-       DB.Close();
-       QueryFromGui++;
-+      if (f)
-+      { lua_pushinteger(L, 1);
-+        return 1;
-+      }
-     }
--    if (f)
--    { lua_pushinteger(L, 1);
--      return 1;
--    }
--    else
--      return 0;
-+    return 0;
-   }
-   static int luadicomquery(lua_State *L)
-   { const char *ae    = lua_tostring(L,1);
-@@ -6410,7 +6409,7 @@ extern "C"
-   static int luadeletedicomobject(lua_State *L)
-   { struct scriptdata *sd = getsd(L);
-     DICOMDataObject *O = NULL;
--    int owned;
-+    int owned = 0;
-     Array < DICOMDataObject * > *A = NULL;
-     if (lua_isuserdata(L,1)) 
-     { lua_getmetatable(L, 1);
diff --git a/debian/patches/series b/debian/patches/series
index 6f3ab7a..8cb5550 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,7 +5,8 @@
 0005-Separate-option-and-description-in-PrintOptions.patch
 0006-Add-DebianBaseDir-at-dgate.cpp.patch
 0007-Change-port-for-CONQUESTSRV1-in-acrnema.map.patch
-0009-Fix-cppcheck-bug-1.patch
-0011-Fix-cppcheck-bug-4.patch
-0012-Fix-cppcheck-bug-5.5.patch
-0014-Patch-mismatches-new-delete-in-flpdu.cxx.patch
+0008-Fix-cppcheck-bug-1.patch
+0009-Fix-cppcheck-bug-4.patch
+0010-Fix-cppcheck-bug-5.5.patch
+0011-Patch-mismatches-new-delete-in-flpdu.cxx.patch
+0012-Fix-cppcheck-bugs-8-and-9-Reviewed-by-Marcel.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/conquest-dicom-server.git



More information about the debian-med-commit mailing list