summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-08-06 00:05:47 +0000
committerKen Raeburn <raeburn@mit.edu>2008-08-06 00:05:47 +0000
commit34f627f9858cd944d2f1f04eac15bae011d55fe0 (patch)
treeb03de3045de7877ceb382e1ea2090b64410fd006 /src
parent9b008de9287d1b8bb5f9a69fe4e26352e1477735 (diff)
downloadkrb5-34f627f9858cd944d2f1f04eac15bae011d55fe0.tar.gz
krb5-34f627f9858cd944d2f1f04eac15bae011d55fe0.tar.xz
krb5-34f627f9858cd944d2f1f04eac15bae011d55fe0.zip
fix cleanup code in allocating preauth info
After an allocation failure, free up the previously allocated array elements by counting back down to zero, not continuing to count up until we hit zero. ticket: new target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20608 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/krb/get_in_tkt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c
index a993870ce..36b731155 100644
--- a/src/lib/krb5/krb/get_in_tkt.c
+++ b/src/lib/krb5/krb/get_in_tkt.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/krb/get_in_tkt.c
*
- * Copyright 1990,1991, 2003 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991, 2003, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -454,7 +454,7 @@ make_preauth_list(krb5_context context,
for (i=0; i<nptypes; i++) {
if ((preauthp[i] =
(krb5_pa_data *) malloc(sizeof(krb5_pa_data))) == NULL) {
- for (; i>=0; i++)
+ for (; i>=0; i--)
free(preauthp[i]);
free(preauthp);
return (ENOMEM);