diff --git a/plugins/in_forward/fw_config.c b/plugins/in_forward/fw_config.c index b3a22931ffd..c6260b8f1b6 100644 --- a/plugins/in_forward/fw_config.c +++ b/plugins/in_forward/fw_config.c @@ -88,10 +88,21 @@ struct flb_in_fw_config *fw_config_init(struct flb_input_instance *i_ins) /* Shared Key */ p = flb_input_get_property("shared_key", i_ins); if (p) { - config->shared_key = flb_sds_create(p); + if (strcmp(p, "\'\'") == 0 || strcmp(p, "\"\"") == 0) { + config->shared_key = flb_sds_create(""); + } + else { + config->shared_key = flb_sds_create(p); + } } else { - config->shared_key = NULL; + config->shared_key = flb_sds_create(""); + } + if (config->shared_key == NULL) { + flb_plg_error(i_ins, "could not initialize shared_key"); + fw_config_destroy(config); + + return NULL; } /* Self Hostname */