krb5_data structure with allocated memory.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23376
dc483132-0cff-0310-8789-
dd5450dbe970
return make_data(str, strlen(str));
}
+static inline krb5_error_code
+alloc_data(krb5_data *data, unsigned int len)
+{
+ char *ptr = (char *) calloc(len, 1);
+
+ if (ptr == NULL)
+ return ENOMEM;
+ data->magic = KV5M_DATA;
+ data->data = ptr;
+ data->length = len;
+ return 0;
+}
+
static inline int
data_eq_string (krb5_data d, char *s)
{