Shouldn't this `free` be outside of the `if`/`else`? Right now, you don't free `value` in the second case, or if neither case is true.