diff --git a/pam/auth_client.c b/pam/auth_client.c
index d5e38fe161eb472abcbae605c9122d691d6f6c02..4f7245f1ab5f515886a09fa90490484bf82bc00a 100644
--- a/pam/auth_client.c
+++ b/pam/auth_client.c
@@ -183,7 +183,7 @@ int auth_client_authenticate(auth_client_t ac,
   curl_easy_setopt(ac->c, CURLOPT_POSTFIELDSIZE, form.size);
 
   // Set request headers.
-  curl_slist_append(headers, "Content-Type: application/x-form-www-urlencoded");
+  headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
   curl_easy_setopt(ac->c, CURLOPT_HTTPHEADER, headers);
 
   // Iterate over the known servers. We create a new response buffer