summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65e795a)
raw | patch | inline | side by side (parent: 65e795a)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 5 Feb 2016 14:16:09 +0000 (15:16 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 5 Feb 2016 14:16:09 +0000 (15:16 +0100) |
This fixes a segfault when no `Tag` option is set.
src/write_sensu.c | patch | blob | history |
diff --git a/src/write_sensu.c b/src/write_sensu.c
index 507018fdd1f6a7688a0672679fdcd63628d58fe3..4d0e473757174e7bdf79b9662bbd258fa049355f 100644 (file)
--- a/src/write_sensu.c
+++ b/src/write_sensu.c
}
// incorporate sensu tags from config if any
- if (strlen(sensu_tags) != 0) {
+ if ((sensu_tags != NULL) && (strlen(sensu_tags) != 0)) {
res = asprintf(&temp_str, "%s, %s", ret_str, sensu_tags);
free(ret_str);
if (res == -1) {
}
// incorporate sensu tags from config if any
- if (strlen(sensu_tags) != 0) {
+ if ((sensu_tags != NULL) && (strlen(sensu_tags) != 0)) {
res = asprintf(&temp_str, "%s, %s", ret_str, sensu_tags);
free(ret_str);
if (res == -1) {