[med-svn] [conquest-dicom-server] 03/04: Patch device.cpp to avoit PatList memory leak
Pablo Lorenzzoni
spectra at moszumanska.debian.org
Wed Feb 5 17:33:25 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 2e66d7cf546c49ec84c03dd560c655635432ab70
Author: Pablo Lorenzzoni <spectra at debian.org>
Date: Wed Feb 5 11:56:02 2014 +0000
Patch device.cpp to avoit PatList memory leak
---
...ppcheck-bug-3-and-others-in-same-function.patch | 46 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 47 insertions(+)
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
new file mode 100644
index 0000000..3170b6a
--- /dev/null
+++ b/debian/patches/0010-Fix-cppcheck-bug-3-and-others-in-same-function.patch
@@ -0,0 +1,46 @@
+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/series b/debian/patches/series
index dc78eab..42b39df 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
0007-Change-port-for-CONQUESTSRV1-in-acrnema.map.patch
0008-Fix-cppcheck-bug-6.patch
0009-Fix-cppcheck-bug-1.patch
+0010-Fix-cppcheck-bug-3-and-others-in-same-function.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