Message ID | pull.1676.v2.git.git.1708375258296.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8f1f2023b758179b31188b665496b514dbb952d6 |
Headers | show |
Series | [v2] libsecret: retrieve empty password | expand |
diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c index 215a81d8bae..90034d0cf1e 100644 --- a/contrib/credential/libsecret/git-credential-libsecret.c +++ b/contrib/credential/libsecret/git-credential-libsecret.c @@ -164,6 +164,9 @@ static int keyring_get(struct credential *c) if (g_strv_length(parts) >= 1) { g_free(c->password); c->password = g_strdup(parts[0]); + } else { + g_free(c->password); + c->password = g_strdup(""); } for (int i = 1; i < g_strv_length(parts); i++) { if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {