out_stackdriver: validate 'list' on error condition (CID 304864)
@@ -508,8 +508,11 @@ static int process_local_resource_id(const void *data, size_t bytes,
return ret;
error:
+ if (list) {
flb_slist_destroy(list);
flb_free(list);
+ }
+
msgpack_unpacked_destroy(&result);
flb_sds_destroy(local_resource_id);
if (strncmp(type, K8S_CONTAINER, len_k8s_container) == 0) {
