Introduce a new variable 'sval' to hold memory allocated with strdup and to free it when unused.
Use clang's static analyzer, scan-build, to find the problem and later to show resolution.
Please upload diffs with context. (Either use diff -U999999 and upload, or use the arc tool associated with Phabricator.)
More surrounding context
This change is bogus. The strdup() memory is owned by the iov structure (iov_base in build_iovec()) and needed by callers. Callers will later free the memory via free_iovec().