fix double free error when current_header and current_value was already added to headers