check return value of alloc functions, from Charles Longeau

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21745 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-07-31 16:11:25 +00:00
parent d3b77d12db
commit 8d40c2994b
22 changed files with 141 additions and 17 deletions

View File

@@ -314,6 +314,8 @@ mit_prop_dump(void *arg, const char *file)
switch(tl_type) {
case mit_KRB5_TL_MOD_PRINC:
buf = malloc(tl_length);
if (buf == NULL)
errx(ENOMEM, "malloc");
getdata(&p, buf, tl_length); /* data itself */
val = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
ret = krb5_parse_name(pd->context, (char *)buf + 4, &princ);