Update src/redis-benchmark.c #707

merged 1 commit into from Oct 10, 2012
Commits on Oct 10, 2012
  1. Update src/redis-benchmark.c

    NanXiao committed Oct 10, 2012
    The code of current implementation:
    if (c->pending == 0) clientDone(c);
    In clientDone function, the c's memory has been freed, then the loop will continue: while(c->pending). The memory of c has been freed now, so c->pending is invalid (c is an invalid pointer now), and this will cause memory dump in some platforams(eg: Solaris).
    So I think the code should be modified as:
    if (c->pending == 0)
    and this will not lead to while(c->pending).