libutil: Remove free() from strnsub()

The free() was added in the wrong assumption that xargs was not
freeing the argument in the position replaced, but it actually
does it.

Also, removing the call to free() makes more general the function.
This commit is contained in:
Roberto E. Vargas Caballero 2023-09-22 11:24:37 +02:00
parent 4e8a096b1c
commit 22f110db28
1 changed files with 0 additions and 1 deletions

View File

@ -56,7 +56,6 @@ strnsubst(char **str, const char *match, const char *replstr, size_t maxsize)
}
strlcpy(s2 + s2len, s1, maxsize - s2len);
done:
free(*str);
*str = s2;
return;
}