free some more memory. check some more return values.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4021 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-11-16 09:49:56 +00:00
parent d294202b45
commit f93ce02560
3 changed files with 17 additions and 6 deletions

View File

@@ -81,6 +81,8 @@ krb5_mk_error(krb5_context context,
}
encode_KRB_ERROR(buf + sizeof(buf) - 1, sizeof(buf), &msg, &reply->length);
reply->data = malloc(reply->length);
if (reply->data == NULL)
return ENOMEM;
memcpy(reply->data, buf + sizeof(buf) - reply->length, reply->length);
return 0;
}