• Yossi Gottlieb's avatar
    Fix a memory leak with log_clear. · 4aeeb548
    Yossi Gottlieb authored
    This is probably most common when loading a snapshot.  Currently it is
    only possibly to free allocated entry memory on log_pop and log_poll,
    but neither are called on log_reset().
    
    This is a quick and non-breaking fix.  A better but not backward
    compatible option can be to have a free function callback as part of
    the entry itself (automatically called when needed, not by log_pop or
    log_poll).  This would also make it easier to avoid redundant buffer
    allocs/copies on the app side.
    4aeeb548
raft_server.c 40.1 KB