summaryrefslogtreecommitdiff
path: root/sysutils/xfce4-diskperf-plugin/files
diff options
context:
space:
mode:
authorDanilo Egea Gondolfo <danilo@FreeBSD.org>2014-09-10 16:32:24 +0000
committerDanilo Egea Gondolfo <danilo@FreeBSD.org>2014-09-10 16:32:24 +0000
commit7cd1c8fc5a11b79d2dab4f0c7fc3b26fae006e64 (patch)
tree0658c8105ccf0634d5b50a17a773ca3cf164fcc0 /sysutils/xfce4-diskperf-plugin/files
parentUpdate to the 20140903 snapshot of GCC 4.9. (diff)
- Fix a memory leak due a improper memset
Notes
Notes: svn path=/head/; revision=367872
Diffstat (limited to 'sysutils/xfce4-diskperf-plugin/files')
-rw-r--r--sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c b/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c
index dc919e92a409..c4199f4b927d 100644
--- a/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c
+++ b/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c
@@ -1,6 +1,6 @@
---- ./panel-plugin/devperf.c.orig 2012-04-03 10:22:41.000000000 -0300
-+++ ./panel-plugin/devperf.c 2013-09-11 17:45:00.000000000 -0300
-@@ -225,6 +225,94 @@
+--- panel-plugin/devperf.c.orig 2012-04-03 13:22:41 UTC
++++ panel-plugin/devperf.c
+@@ -225,6 +225,93 @@
/************************** Linux End ***************/
@@ -22,8 +22,13 @@
+
+#define MAXNAMELEN 256
+
++struct statinfo stats;
++struct devinfo dinfo;
++
+int DevPerfInit ()
+{
++ stats.dinfo = &dinfo;
++
+ return (0);
+}
+
@@ -36,17 +41,11 @@
+{
+ struct timeval tv;
+ struct timespec ts;
-+ struct statinfo stats;
-+ struct devinfo dinfo;
+ struct devstat dev;
+ kvm_t *kd = NULL;
+ int i, found = 0;
+ char *check_dev = (char *) p_pvDevice;
+
-+ memset(&stats, 0, sizeof(stats));
-+ memset(&dinfo, 0, sizeof(dinfo));
-+ stats.dinfo = &dinfo;
-+
+ if(devstat_getdevs(kd, &stats) == -1) {
+ syslog(0, "DISKPERF: getdevs fail");
+ }