summaryrefslogtreecommitdiffstats
path: root/collectors/apps.plugin
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2019-10-02 10:59:48 +0000
committerGitHub <noreply@github.com>2019-10-02 10:59:48 +0000
commitf197e2d9901be1b462edd53b227e01f5d7a9483a (patch)
treeea1d3cd229de5d84a7696a9275af7b1fd2c6cf06 /collectors/apps.plugin
parent1d667b145c16811639143afa377293d3ef8d62f0 (diff)
Coverity 20190924 (#6941)
* coverity_20190924: Fix 215633 In the switch the library stops case this pointer is NULL, so there is not necessity to processed with tests * coverity_20190924: Fix 338067 The current code tries to copy the same size of the variable, another possible solution would be to use a function to sanitize the code, I will try this first * coverity_20190924: Fix 348638 Considering that we are testing the variable value one line above The division will always happen * coverity_20190924: Fix 348640 For this specific case we do not have the possibility to have memory leak, valgrind confirms this, but I am adding a new variable here to the stack to discard the warning
Diffstat (limited to 'collectors/apps.plugin')
-rw-r--r--collectors/apps.plugin/apps_plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c
index 29d38bb417..4dcbd38b7d 100644
--- a/collectors/apps.plugin/apps_plugin.c
+++ b/collectors/apps.plugin/apps_plugin.c
@@ -3521,7 +3521,7 @@ static void send_collected_data_to_netdata(struct target *root, const char *type
send_BEGIN(type, "uptime_avg", dt);
for (w = root; w ; w = w->next) {
if(unlikely(w->exposed && w->processes))
- send_SET(w->name, w->processes?(w->uptime_sum / w->processes):0);
+ send_SET(w->name, w->uptime_sum / w->processes);
}
send_END();