Skip to content

Commit

Permalink
minor code re-writes to avoid coverity false positives; updated insta…
Browse files Browse the repository at this point in the history
…ller banner and readme
  • Loading branch information
ktsaou committed Aug 21, 2016
1 parent 6234746 commit 14213f5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

# netdata


> Aug 21st, 2016: Netdata got **[health monitoring](https://github.com/firehol/netdata/wiki/health-monitoring)** - alarms
---

> May 16th, 2016
>
> [netdata v1.2.0 released!](https://github.com/firehol/netdata/releases)
Expand Down
4 changes: 3 additions & 1 deletion netdata-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# reload the user profile
[ -f /etc/profile ] && . /etc/profile

export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"

# fix PKG_CHECK_MODULES error
if [ -d /usr/share/aclocal ]
then
Expand Down Expand Up @@ -175,7 +177,7 @@ done
cat <<BANNER
Welcome to netdata!
Nice to see you are giving it a try!
The real-time performance monitoring system.
You are about to build and install netdata to your system.
Expand Down
14 changes: 8 additions & 6 deletions src/plugin_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ static inline struct tc_class *tc_class_index_find(struct tc_device *st, const c
// ----------------------------------------------------------------------------

static inline void tc_class_free(struct tc_device *n, struct tc_class *c) {
debug(D_TC_LOOP, "Removing from device '%s' class '%s', parentid '%s', leafid '%s', seen=%d", n->id, c->id, c->parentid?c->parentid:"", c->leafid?c->leafid:"", c->seen);

if(c == n->classes) {
if(c->next)
n->classes = c->next;
else
n->classes = c->prev;
}
if(c->next) c->next->prev = c->prev;
if(c->prev) c->prev->next = c->next;
if(n->classes == c) {
if(c->next) n->classes = c->next;
else n->classes = c->prev;
}

debug(D_TC_LOOP, "Removing from device '%s' class '%s', parentid '%s', leafid '%s', seen=%d", n->id, c->id, c->parentid?c->parentid:"", c->leafid?c->leafid:"", c->seen);

tc_class_index_del(n, c);

Expand Down
17 changes: 9 additions & 8 deletions src/rrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,16 +722,17 @@ void rrddim_free(RRDSET *st, RRDDIM *rd)
{
debug(D_RRD_CALLS, "rrddim_free() %s.%s", st->name, rd->name);

RRDDIM *i, *last = NULL;
for(i = st->dimensions; i && i != rd ; i = i->next) last = i;
if(rd == st->dimensions)
st->dimensions = rd->next;
else {
RRDDIM *i;
for (i = st->dimensions; i && i->next != rd; i = i->next) ;

if(!i) {
error("Request to free dimension %s.%s but it is not linked.", st->id, rd->name);
return;
if (i && i->next == rd)
i->next = rd->next;
else
error("Request to free dimension '%s.%s' but it is not linked.", st->id, rd->name);
}

if(last) last->next = rd->next;
else st->dimensions = rd->next;
rd->next = NULL;

while(rd->variables)
Expand Down

0 comments on commit 14213f5

Please sign in to comment.