SF.net SVN: nagiosplug:[2211] nagiosplug/trunk
| Newsgroups | gmane.network.nagios.plugins.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2211
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2211&view=rev
Author: dermoth
Date: 2009-06-06 05:56:26 +0000 (Sat, 06 Jun 2009)
Log Message:
-----------
Fix the memory allocation for the thresholds data
Allocate the appropriate amount of memory for storing the thresholds
data. Before, we allocated the amount of memory required for storing a
_pointer_ to the thresholds data. This crashed (at least) check_mysql
when using its "-S" option on FreeBSD/amd64 (as reported and analyzed by
Nikita Kalabukhov - 2797757).
Signed-off-by: Holger Weiss <[email protected]>
Modified Paths:
--------------
nagiosplug/trunk/THANKS.in
nagiosplug/trunk/lib/utils_base.c
Modified: nagiosplug/trunk/THANKS.in
===================================================================
--- nagiosplug/trunk/THANKS.in 2009-06-06 05:56:17 UTC (rev 2210)
+++ nagiosplug/trunk/THANKS.in 2009-06-06 05:56:26 UTC (rev 2211)
@@ -254,3 +254,4 @@
Martin Foster
Joe Presbrey
Will Preston
+Nikita Kalabukhov
Modified: nagiosplug/trunk/lib/utils_base.c
===================================================================
--- nagiosplug/trunk/lib/utils_base.c 2009-06-06 05:56:17 UTC (rev 2210)
+++ nagiosplug/trunk/lib/utils_base.c 2009-06-06 05:56:26 UTC (rev 2211)
@@ -101,7 +101,9 @@
{
thresholds *temp_thresholds = NULL;
- temp_thresholds = malloc(sizeof(temp_thresholds));
+ if ((temp_thresholds = malloc(sizeof(thresholds))) == NULL)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s\n"),
+ strerror(errno));
temp_thresholds->warning = NULL;
temp_thresholds->critical = NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get