From 551fc2f91124f5b1f2dc2339c707d5459f9959f7 Mon Sep 17 00:00:00 2001 From: Christian Zentgraf Date: Tue, 12 Nov 2024 11:14:30 -0800 Subject: [PATCH] fix: security issues found by static scan (#11487) Summary: - Possible memory leak Pull Request resolved: https://github.com/facebookincubator/velox/pull/11487 Reviewed By: pedroerp Differential Revision: D65763889 Pulled By: kevinwilfong fbshipit-source-id: d50c47e80a2a4783e8a9193a801a7f733cb55f2b --- velox/tpch/gen/dbgen/dbgen_gunk.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/velox/tpch/gen/dbgen/dbgen_gunk.cpp b/velox/tpch/gen/dbgen/dbgen_gunk.cpp index bd598c452fcf..0a57b4e77056 100644 --- a/velox/tpch/gen/dbgen/dbgen_gunk.cpp +++ b/velox/tpch/gen/dbgen/dbgen_gunk.cpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /* * Copyright owned by the Transaction Processing Performance Council. * @@ -57,6 +72,10 @@ static void cleanup_dist(distribution* target) { } free(target->list); } + /* Allocated from permute_dist */ + if (target->permute) { + free(target->permute); + } } void cleanup_dists(void) {