summaryrefslogtreecommitdiff
path: root/net/nagios-plugins/patches
diff options
context:
space:
mode:
authortonnerre <tonnerre>2008-06-08 14:08:47 +0000
committertonnerre <tonnerre>2008-06-08 14:08:47 +0000
commitf501e8bfef30162b12279c762d4bfe81fb9c1406 (patch)
treeac0f7ab7b6cd4065bfe2cb0530c8589b8ca99a9a /net/nagios-plugins/patches
parent09be71552253730b0e944d5944ae5653b2cde1c1 (diff)
downloadpkgsrc-f501e8bfef30162b12279c762d4bfe81fb9c1406.tar.gz
Remove some broken malloc logic from the nagios-plugins library.
Discovered and patch provided by Wolfgang Solfrank.
Diffstat (limited to 'net/nagios-plugins/patches')
-rw-r--r--net/nagios-plugins/patches/patch-aa26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/nagios-plugins/patches/patch-aa b/net/nagios-plugins/patches/patch-aa
new file mode 100644
index 00000000000..7407e1a7a0f
--- /dev/null
+++ b/net/nagios-plugins/patches/patch-aa
@@ -0,0 +1,26 @@
+$NetBSD: patch-aa,v 1.3 2008/06/08 14:08:47 tonnerre Exp $
+
+--- lib/utils_base.c.orig 2007-07-29 14:42:05.000000000 +0200
++++ lib/utils_base.c
+@@ -89,7 +89,7 @@ _set_thresholds(thresholds **my_threshol
+ {
+ thresholds *temp_thresholds = NULL;
+
+- temp_thresholds = malloc(sizeof(temp_thresholds));
++ temp_thresholds = malloc(sizeof(*temp_thresholds));
+
+ temp_thresholds->warning = NULL;
+ temp_thresholds->critical = NULL;
+@@ -105,10 +105,9 @@ _set_thresholds(thresholds **my_threshol
+ }
+ }
+
+- if (*my_thresholds > 0) { /* Not sure why, but sometimes could be -1 */
+- /* printf("Freeing here: %d\n", *my_thresholds); */
++ if (*my_thresholds)
+ free(*my_thresholds);
+- }
++
+ *my_thresholds = temp_thresholds;
+
+ return 0;