summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-11-29 15:58:44 +0200
committerGitHub <noreply@github.com>2023-11-29 15:58:44 +0200
commit3e94c0a8ef5ba820c30dd45665217454cceff61f (patch)
tree93230e1ef56fe30af886488d1131368bab62ac8f
parentb1465aa5895326c4100e3b535364ca78f91b6f71 (diff)
Fix CID 410152 Dereference after null check (#16502)
-rw-r--r--daemon/analytics.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon/analytics.c b/daemon/analytics.c
index f942bd8150..4226b14655 100644
--- a/daemon/analytics.c
+++ b/daemon/analytics.c
@@ -978,8 +978,10 @@ void send_statistics(const char *action, const char *action_result, const char *
if (!netdata_anonymous_statistics_enabled || !action)
return;
- if (!action_result || !action_data)
+ if (!action_result)
action_result = "";
+ if (!action_data)
+ action_data = "";
char *command_to_run = mallocz(
sizeof(char) * (strlen(action) + strlen(action_result) + strlen(action_data) + strlen(as_script) +