From 235f23326711a40f3e4cd7417c5fdd75a0157fde Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 07:27:50 +0000 Subject: Apply patch 0002-Use-strdup-if-offset-are-used.patch patch_name: 0002-Use-strdup-if-offset-are-used.patch present_in_specfile: true location_in_specfile: 2 --- diff --git a/library/adenroll.c b/library/adenroll.c index d1020e9..05885d0 100644 --- a/library/adenroll.c +++ b/library/adenroll.c @@ -1318,9 +1318,9 @@ load_keytab_entry (krb5_context k5, } else if (!enroll->host_fqdn && _adcli_str_has_prefix (name, "host/") && strchr (name, '.')) { /* Skip host/ prefix */ - enroll->host_fqdn = name + 5; - _adcli_info ("Found host qualified name in keytab: %s", name); - name = NULL; + enroll->host_fqdn = strdup (name + 5); + return_val_if_fail (enroll->host_fqdn != NULL, FALSE); + _adcli_info ("Found host qualified name in keytab: %s", enroll->host_fqdn); } }