[gnome-online-accounts] kerberos: consolidate exit path code in identity_renew
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] kerberos: consolidate exit path code in identity_renew
- Date: Mon, 17 Mar 2014 14:05:35 +0000 (UTC)
commit d020a841c56b5264f8c5f07dabb82b9939ab2e93
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Mar 17 09:44:05 2014 -0400
kerberos: consolidate exit path code in identity_renew
the principal is freed in 3 different places. This commit
consolidates it to one place for clarity and added robustness
against future changes.
https://bugzilla.gnome.org/show_bug.cgi?id=726353
src/goaidentity/goakerberosidentity.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/goaidentity/goakerberosidentity.c b/src/goaidentity/goakerberosidentity.c
index e1e3ff5..4fcc881 100644
--- a/src/goaidentity/goakerberosidentity.c
+++ b/src/goaidentity/goakerberosidentity.c
@@ -1388,8 +1388,7 @@ goa_kerberos_identity_renew (GoaKerberosIdentity *self, GError **error)
_
("Could not get new credentials to renew identity %s: %k"),
name);
- krb5_free_principal (self->priv->kerberos_context, principal);
- goto out;
+ goto free_principal;
}
if (!goa_kerberos_identity_update_credentials (self,
@@ -1397,13 +1396,13 @@ goa_kerberos_identity_renew (GoaKerberosIdentity *self, GError **error)
&new_credentials,
error))
{
- krb5_free_principal (self->priv->kerberos_context, principal);
- goto out;
+ goto free_principal;
}
g_debug ("GoaKerberosIdentity: identity %s renewed", name);
renewed = TRUE;
+free_principal:
krb5_free_principal (self->priv->kerberos_context, principal);
out:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]