summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2016-03-07 23:20:31 +0100
committerAdam Jackson <ajax@redhat.com>2016-03-08 10:20:00 -0500
commitd0c1a5bc61a3d151f2234aa3820862f16c0f00c7 (patch)
tree7de6066cb08af77362287ad75da3715bc765d8ee
parentacf263df81ad6813e0233033610fb44521cab1b4 (diff)
xwin: no need to free auth data if AddResource fails
This is taken care of by SecurityDeleteAuthorization Reviewed-by: RĂ©mi Cardona <remi@gentoo.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--hw/xwin/winauth.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index 7efa1c00f..7be7dcae1 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -114,7 +114,6 @@ GenerateAuthorization(unsigned name_length,
Bool
winGenerateAuthorization(void)
{
- Bool fFreeAuth = FALSE;
SecurityAuthorizationPtr pAuth = NULL;
/* Call OS layer to generate authorization key */
@@ -123,7 +122,7 @@ winGenerateAuthorization(void)
0, NULL, &g_uiAuthDataLen, &g_pAuthData);
if ((XID) ~0L == g_authId) {
ErrorF("winGenerateAuthorization - GenerateAuthorization failed\n");
- goto auth_bailout;
+ return FALSE;
}
else {
@@ -139,7 +138,7 @@ winGenerateAuthorization(void)
if (!(pAuth)) {
ErrorF("winGenerateAuthorization - Failed allocating "
"SecurityAuthorizationPtr.\n");
- goto auth_bailout;
+ return FALSE;
}
/* Fill in the auth fields */
@@ -155,21 +154,11 @@ winGenerateAuthorization(void)
/* Add the authorization to the server's auth list */
if (!AddResource(g_authId, SecurityAuthorizationResType, pAuth)) {
ErrorF("winGenerateAuthorization - AddResource failed for auth.\n");
- fFreeAuth = TRUE;
- goto auth_bailout;
+ return FALSE;
}
-
- /* Don't free the auth data, since it is still used internally */
- pAuth = NULL;
#endif
return TRUE;
-
- auth_bailout:
- if (fFreeAuth)
- free(pAuth);
-
- return FALSE;
}
/* Use our generated cookie for authentication */