• M
    Fix potential leak when reusing PinnableSlice instances. (#10166) · 77f47995
    mpoeter 提交于
    Summary:
    `PinnableSlice` may hold a handle to a cache value which must be released to correctly decrement the ref-counter. However, when `PinnableSlice` variables are reused, e.g. like this:
    ```
    PinnableSlice pin_slice;
    db.Get("foo", &pin_slice);
    db.Get("foo", &pin_slice);
    ```
    then the second `Get` simply overwrites the old value in `pin_slice` and the handle returned by the first `Get` is _not_ released.
    
    This PR adds `Reset` calls to the `Get`/`MultiGet` calls that accept `PinnableSlice` arguments to ensure proper cleanup of old values.
    
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/10166
    
    Reviewed By: hx235
    
    Differential Revision: D37151632
    
    Pulled By: ajkr
    
    fbshipit-source-id: 9dd3c3288300f560531b843f67db11aeb569a9ff
    77f47995
db_impl.cc 194.6 KB