The functions pv_parse_hdr_name, pv_parse_avp_name and pv_parse_index allocate a nsp variable and after that call pv_parse_spec. If pv_parse_spec is not successful, the functions return without freeing nsp. I'm not sure if pv_parse_spec retains a reference to nsp, but if not there is clearly a mem leak. -- Dan