Try to not leak memory.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18828 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -122,6 +122,7 @@ main (int argc, char **argv)
|
||||
krb5_err(context, 1, ret,
|
||||
"Failed to remove principal %s", credential);
|
||||
|
||||
krb5_free_principal(context, mcred.server);
|
||||
krb5_free_context(context);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -207,7 +207,9 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
krb5_free_creds(context, out);
|
||||
krb5_free_principal(context, server);
|
||||
krb5_get_creds_opt_free(context, opt);
|
||||
krb5_cc_close (context, cache);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -468,6 +468,7 @@ get_new_tickets(krb5_context context,
|
||||
krb5_deltat start_time = 0;
|
||||
krb5_deltat renew = 0;
|
||||
char *renewstr = NULL;
|
||||
krb5_enctype *enctype = NULL;
|
||||
|
||||
passwd[0] = '\0';
|
||||
|
||||
@@ -552,8 +553,8 @@ get_new_tickets(krb5_context context,
|
||||
}
|
||||
|
||||
if(etype_str.num_strings) {
|
||||
krb5_enctype *enctype = NULL;
|
||||
int i;
|
||||
|
||||
enctype = malloc(etype_str.num_strings * sizeof(*enctype));
|
||||
if(enctype == NULL)
|
||||
errx(1, "out of memory");
|
||||
@@ -682,6 +683,9 @@ get_new_tickets(krb5_context context,
|
||||
|
||||
krb5_free_cred_contents (context, &cred);
|
||||
|
||||
if (enctype)
|
||||
free(enctype);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user