Skip to content

Commit

Permalink
fix: delete iter before returns (#2785)
Browse files Browse the repository at this point in the history
* delete iter before return

---------

Co-authored-by: wangshaoyi <[email protected]>
  • Loading branch information
2 people authored and brother-jin committed Jul 8, 2024
1 parent 525eded commit 6778f59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/storage/src/redis_strings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,7 @@ rocksdb::Status Redis::PKPatternMatchDel(const std::string& pattern, int32_t* re
batch.Clear();
} else {
*ret = total_delete;
delete iter;
return s;
}
}
Expand All @@ -1761,6 +1762,7 @@ rocksdb::Status Redis::PKPatternMatchDel(const std::string& pattern, int32_t* re
}
}

delete iter;
*ret = total_delete;
return s;
}
Expand Down

0 comments on commit 6778f59

Please sign in to comment.