From c300cfbb73a9423df6223f3cc28d56d0f751158c Mon Sep 17 00:00:00 2001 From: June 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(+) (limited to 'bin') diff --git a/bin/title.c b/bin/title.c index d5238b1a..0168e2c9 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