Skip to content

Commit

Permalink
Free bitmap in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjant committed Jan 9, 2025
1 parent e14fa40 commit cce62ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ydb/library/yql/udfs/common/roaring/roaring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,8 @@ namespace {
TUnboxedValue Run(const IValueBuilder* valueBuilder,
const TUnboxedValuePod* args) const override {
Y_UNUSED(valueBuilder);
auto* bitmap = roaring_bitmap_create();
try {
auto* bitmap = roaring_bitmap_create();

const auto vector = args[0];
const auto* elements = vector.GetElements();
if (elements) {
Expand All @@ -304,6 +303,7 @@ namespace {

return TUnboxedValuePod(new TRoaringWrapper(bitmap));
} catch (const std::exception& e) {
roaring_bitmap_free(bitmap);
UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data());
}
}
Expand Down

0 comments on commit cce62ff

Please sign in to comment.