filter_kubernetes: validate upstream creation (CID 166135)
@@ -579,6 +579,10 @@ static int flb_kube_network_init(struct flb_kube *ctx, struct flb_config *config
ctx->api_port,
io_type,
&ctx->tls);
+ if (!ctx->upstream) {
+ /* note: if ctx->tls.context is set, it's destroyed upon context exit */
+ return -1;
+ }
/* Remove async flag from upstream */
ctx->upstream->flags &= ~(FLB_IO_ASYNC);
