aboutsummaryrefslogtreecommitdiffstats
path: root/lib/krb5/asn1_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/krb5/asn1_glue.c')
-rw-r--r--lib/krb5/asn1_glue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/krb5/asn1_glue.c b/lib/krb5/asn1_glue.c
index a821faff93e8..6df8defbce9a 100644
--- a/lib/krb5/asn1_glue.c
+++ b/lib/krb5/asn1_glue.c
@@ -53,9 +53,9 @@ _krb5_principalname2krb5_principal (krb5_context context,
krb5_error_code ret;
krb5_principal p;
- p = malloc(sizeof(*p));
+ p = calloc(1, sizeof(*p));
if (p == NULL)
- return ENOMEM;
+ return krb5_enomem(context);
ret = copy_PrincipalName(&from, &p->name);
if (ret) {
free(p);
@@ -65,7 +65,7 @@ _krb5_principalname2krb5_principal (krb5_context context,
if (p->realm == NULL) {
free_PrincipalName(&p->name);
free(p);
- return ENOMEM;
+ return krb5_enomem(context);
}
*principal = p;
return 0;