Added missing error handler
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2419
dc483132-0cff-0310-8789-
dd5450dbe970
tmpprinc = (krb5_principal) malloc(sizeof(krb5_principal_data));
if (tmpprinc == NULL)
return KRB5_CC_NOMEM;
- tmpprinc->data = malloc(length * sizeof(krb5_principal_data));
+ tmpprinc->data = (krb5_data *) malloc(length * sizeof(krb5_data));
if (tmpprinc->data == 0) {
free((char *)tmpprinc);
return KRB5_CC_NOMEM;
}
data->data[data->length] = 0; /* Null terminate just in case.... */
return KRB5_OK;
+ errout:
+ if (data->data)
+ xfree(data->data);
+ return kret;
}
krb5_error_code