[icinga-checkins] icinga.org: icinga-core/master: common/objects.c: Use calloc() instead of malloc() + manual NULL'ing (Andreas Ericsson)

git at icinga.org git at icinga.org
Wed May 19 13:41:52 CEST 2010


Module: icinga-core
Branch: master
Commit: dd394c80b9aa0547d875169e172acb72d2b0731d
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=dd394c80b9aa0547d875169e172acb72d2b0731d

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed May 12 19:36:42 2010 +0200

common/objects.c: Use calloc() instead of malloc() + manual NULL'ing (Andreas Ericsson)

[--snip--]
calloc() always returns a fully null'ed out buffer. In case we
get the memory from the kernel, this has already been done, so
the manual setting of variables was quite unnecessary. As a
nice side-effect, we save about 250 lines of code, some random
cycles and can get rid of even more conditional code.
[--snip--]

really nice patch. checked against escalation_condition, it's fine.

fixes #399

---

 Changelog        |    1 +
 common/objects.c |  295 +++++-------------------------------------------------
 2 files changed, 26 insertions(+), 270 deletions(-)

Diff:   https://git.icinga.org/?p=icinga-core.git;a=commitdiff;h=dd394c80b9aa0547d875169e172acb72d2b0731d




More information about the icinga-checkins mailing list