diff --git a/lib/hx509/error.c b/lib/hx509/error.c index f44627e90..32c92cf1b 100644 --- a/lib/hx509/error.c +++ b/lib/hx509/error.c @@ -153,9 +153,9 @@ hx509_get_error_string(hx509_context context, int error_code) s = heim_error_copy_string(msg); if (s) { - str = heim_string_get_utf8(s); - if (str) - str = strdup(str); + const char *cstr = heim_string_get_utf8(s); + if (cstr) + str = strdup(cstr); heim_release(s); } return str;