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
/*
* 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
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);