From: Theodore Tso Date: Thu, 3 Jun 1993 00:11:44 +0000 (+0000) Subject: Fix bug where an allocated structure was used before it was checked to X-Git-Tag: krb5-1.0-beta3~286 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=22a9b4318e323040f7931281cf8914d07c07210a;p=krb5.git Fix bug where an allocated structure was used before it was checked to see if it were null. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2552 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/copy_auth.c b/src/lib/krb5/krb/copy_auth.c index c4352191c..f3d19865e 100644 --- a/src/lib/krb5/krb/copy_auth.c +++ b/src/lib/krb5/krb/copy_auth.c @@ -65,13 +65,13 @@ krb5_authdata ***outauthdat; krb5_authdata ** tempauthdat; register int nelems = 0; - while (inauthdat[nelems]) nelems++; - if (!inauthdat) { *outauthdat = 0; return 0; } + while (inauthdat[nelems]) nelems++; + /* one more for a null terminated list */ if (!(tempauthdat = (krb5_authdata **) calloc(nelems+1, sizeof(*tempauthdat))))