Auth: fix leak of username

When collect_credentials() returns a failure status, 'username' was
potentially leaked.
This commit is contained in:
Jonathon Jongsma 2014-08-12 11:01:46 -05:00
parent ad8966ccf9
commit b7c8049460

View File

@ -744,17 +744,16 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
"oVirt",
NULL,
&username, &password);
if (ret < 0) {
return FALSE;
} else {
if (ret == 0) {
g_object_set(G_OBJECT(proxy),
"username", username,
"password", password,
NULL);
g_free(username);
g_free(password);
return TRUE;
}
g_free(username);
g_free(password);
return (ret == 0);
}