fixed segfault in free(), used strlen of wrong variable. fixes #5