BUG: https://bugzilla.samba.org/show_bug.cgi?id=15482
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
unsigned int component)
{
#if defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING)
- return talloc_strdup(mem_ctx, krb5_principal_get_comp_string(context, principal, component));
+ const char *str = NULL;
+
+ str = krb5_principal_get_comp_string(context, principal, component);
+ if (str == NULL) {
+ return NULL;
+ }
+
+ return talloc_strdup(mem_ctx, str);
#else
krb5_data *data;