Blame SOURCES/0002-Use-strdup-if-offset-are-used.patch

48b328
From 4ba49015ca1ad98c03a209a11862f8e00d00fbd0 Mon Sep 17 00:00:00 2001
48b328
From: Sumit Bose <sbose@redhat.com>
48b328
Date: Wed, 24 Aug 2016 16:19:36 +0200
48b328
Subject: [PATCH 02/23] Use strdup() if offset are used
48b328
48b328
Strings with an offset to the original starting point must be copied
48b328
because otherwise they cannot be properly freed later.
48b328
---
48b328
 library/adenroll.c | 6 +++---
48b328
 1 file changed, 3 insertions(+), 3 deletions(-)
48b328
48b328
diff --git a/library/adenroll.c b/library/adenroll.c
48b328
index d1020e9..05885d0 100644
48b328
--- a/library/adenroll.c
48b328
+++ b/library/adenroll.c
48b328
@@ -1318,9 +1318,9 @@ load_keytab_entry (krb5_context k5,
48b328
 
48b328
 		} else if (!enroll->host_fqdn && _adcli_str_has_prefix (name, "host/") && strchr (name, '.')) {
48b328
 			/* Skip host/ prefix */
48b328
-			enroll->host_fqdn = name + 5;
48b328
-			_adcli_info ("Found host qualified name in keytab: %s", name);
48b328
-			name = NULL;
48b328
+			enroll->host_fqdn = strdup (name + 5);
48b328
+			return_val_if_fail (enroll->host_fqdn != NULL, FALSE);
48b328
+			_adcli_info ("Found host qualified name in keytab: %s", enroll->host_fqdn);
48b328
 		}
48b328
 	}
48b328
 
48b328
-- 
48b328
2.14.4
48b328