From f2530076c384d4f4885d0b80b86c26d52c6f9779 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 10 Feb 2020 21:52:38 -0500 Subject: Duplicate effective URL before passing it back to curl Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. --- bin/title.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/title.c b/bin/title.c index 0208f862..d85fa9ac 100644 --- a/bin/title.c +++ b/bin/title.c @@ -127,8 +127,12 @@ static CURLcode fetchTitle(const char *url) { char *dest; curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &dest); + dest = strdup(dest); + if (!dest) err(EX_OSERR, "strdup"); + code = curl_easy_setopt(curl, CURLOPT_URL, dest); if (code) return code; + free(dest); body.len = 0; title = false; -- cgit 1.4.1