diff options
author | tonnerre <tonnerre> | 2008-06-08 14:08:47 +0000 |
---|---|---|
committer | tonnerre <tonnerre> | 2008-06-08 14:08:47 +0000 |
commit | f501e8bfef30162b12279c762d4bfe81fb9c1406 (patch) | |
tree | ac0f7ab7b6cd4065bfe2cb0530c8589b8ca99a9a /net/nagios-plugins/patches | |
parent | 09be71552253730b0e944d5944ae5653b2cde1c1 (diff) | |
download | pkgsrc-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-aa | 26 |
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; |