nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.83k stars 304 forks source link

Fix websocket-related subscribe segfault #42

Closed ghost closed 12 years ago

ghost commented 12 years ago

Hey,

Had a look into this issue just now. This seems to solve the problem for me. It's issue #31 on your tracker.

Cheers,

Rob

Commit message:

If one sent a [p]subscribe command through a websocket, the cmd struct got freed after the first response was received. Subscribe commands generate multiple responses, so this resulted in accessing already-freed data, and double-freeing.

This patch adds a check to see if it's a subscribe command, and if it is avoids the freeing.

nicolasff commented 12 years ago

Merged, thanks!